nginx 1.9 не может запустить другой порт, чем 80

Я установил phpmyadmin, удалил apache2, затем настроенный в/etc/nginx/sites-available/phpmyadmin как ниже

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
        listen 8081;
        listen [::]:8081;

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /usr/share/phpmyadmin;

        # Add index.php to the list if you are using PHP
        index index.php index.html index.htm index.nginx-debian.html;

        #server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
                include snippets/fastcgi-php.conf;

        #       # With php7.0-cgi alone:
        #       fastcgi_pass 127.0.0.1:9000;
        #       # With php7.0-fpm:
                fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
                deny all;
        }
}

Я могу только видеть порт 80 открытых

$ sudo netstat -tlnp | grep nginx
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      25160/nginx -g daem
tcp6       0      0 :::80                   :::*                    LISTEN      25160/nginx -g daem

Кажется, существует ошибка, показанная с nginx состоянием

$ sudo systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2016-07-10 14:43:33 MYT; 44min ago
  Process: 25150 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
  Process: 25157 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 25153 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 25160 (nginx)
    Tasks: 2
   Memory: 1.8M
      CPU: 54ms
   CGroup: /system.slice/nginx.service
           ├─25160 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
           └─25161 nginx: worker process

Jul 10 14:43:33 ubuntu systemd[1]: Stopped A high performance web server and a reverse proxy server.
Jul 10 14:43:33 ubuntu systemd[1]: Starting A high performance web server and a reverse proxy server...
Jul 10 14:43:33 ubuntu systemd[1]: nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument
Jul 10 14:43:33 ubuntu systemd[1]: Started A high performance web server and a reverse proxy server.

php7.0-fpm кажется хорошо

$ sudo systemctl status php7.0-fpm
● php7.0-fpm.service - The PHP 7.0 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.0-fpm.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2016-07-10 14:46:02 MYT; 46min ago
  Process: 25178 ExecStartPre=/usr/lib/php/php7.0-fpm-checkconf (code=exited, status=0/SUCCESS)
 Main PID: 25187 (php-fpm7.0)
   Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
    Tasks: 3
   Memory: 18.2M
      CPU: 272ms
   CGroup: /system.slice/php7.0-fpm.service
           ├─25187 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)
           ├─25190 php-fpm: pool www
           └─25191 php-fpm: pool www

Jul 10 14:46:02 ubuntu systemd[1]: Stopping The PHP 7.0 FastCGI Process Manager...
Jul 10 14:46:02 ubuntu systemd[1]: Stopped The PHP 7.0 FastCGI Process Manager.
Jul 10 14:46:02 ubuntu systemd[1]: Starting The PHP 7.0 FastCGI Process Manager...
Jul 10 14:46:02 ubuntu systemd[1]: Started The PHP 7.0 FastCGI Process Manager.

Моя конфигурация неправильно?

0
задан 10 July 2016 в 10:42

1 ответ

Символьная ссылка/etc/nginx/sites-available/phpmyadmin на/etc/nginx/sites-enabled/phpmyadmin & nginx

перезапуска, который Это вызвано тем, что это, как предполагается, сделано для создания работ virtualhost.

-1
ответ дан 28 September 2019 в 23:57

Другие вопросы по тегам:

Похожие вопросы: