Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi all,
I am trying to solve this issue for few weeks to no avail :( I am trying to set up multiple websites in my Ubuntu 16.04 droplet by following this guide: https://www.digitalocean.com/community/tutorials/how-to-host-multiple-websites-securely-with-nginx-and-php-fpm-on-ubuntu-14-04
Problem is, domain1.com does NOT work (it shows empty pages), while domain2.com works fine.
I have this error and I do not know why:
$ php-fpm7.0 -y /etc/php/7.0/fpm/php-fpm.conf
[20-Apr-2017 16:48:28.895668] ERROR: pid 14360, fpm_sockets_new_listening_socket(), line 182: An another FPM instance seems to already listen on /var/run/php/php7.0-fpm-domain1.sock
[20-Apr-2017 16:48:28.895927] ERROR: pid 14360, fpm_init(), line 74: FPM initialization failed
These are the processes for php-fpm:
root 14272 0.0 3.1 364016 32140 ? Ss 16:39 0:00 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)
domain1 14276 0.0 0.7 364008 7996 ? S 16:39 0:00 php-fpm: pool domain1
domain1 14277 0.0 1.1 364392 11312 ? S 16:39 0:00 php-fpm: pool domain1
domain2 14278 0.0 0.7 364008 7996 ? S 16:39 0:00 php-fpm: pool domain2
domain2 14279 0.0 0.7 364008 7996 ? S 16:39 0:00 php-fpm: pool domain2
and the sockets:
$ ll /var/run/php/
total 4
drwxr-xr-x 2 www-data www-data 100 Apr 20 16:39 ./
drwxr-xr-x 26 root root 1080 Apr 20 16:11 ../
srw-rw---- 1 domain2 www-data 0 Apr 20 16:39 php7.0-fpm-domain2.sock=
srw-rw---- 1 domain1 www-data 0 Apr 20 16:39 php7.0-fpm-domain1.sock=
-rw-r--r-- 1 root root 5 Apr 20 16:39 php7.0-fpm.pid
server {
# redirect www.domain.com to domain.com
server_name www.domain1.com;
return 301 $scheme://domain1.com$request_uri;
}
server {
root /var/www/domain1/public_html;
server_name domain1.com;
#access_log /var/log/nginx/domain1.access.log;
#error_log /var/log/nginx/domain1.error.log;
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm-domain1.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
include global/common.conf;
include global/wordpress.conf;
}
server {
# redirect www.domain.com to domain.com
server_name domain2.com;
return 301 $scheme://www.domain2.com$request_uri;
}
server {
root /var/www/domain2/public_html;
server_name www.domain2.com;
#access_log /var/log/nginx/domain2.access.log;
#error_log /var/log/nginx/domain2.error.log;
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm-domain2.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
include global/common.conf;
include global/wordpress.conf;
}
# Global configuration file.
# ESSENTIAL : Configure Nginx Listening Port
listen 80;
#listen [::]:80;
# ESSENTIAL : Default file to serve. If the first file isn't found,
index index.php index.html index.htm;
# ESSENTIAL : no favicon logs
location = /favicon.ico {
log_not_found off;
access_log off;
}
# ESSENTIAL : robots.txt
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# ESSENTIAL : Configure 404 Pages
error_page 404 /404.html;
# ESSENTIAL : Configure 50x Pages
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
# SECURITY : Deny all attempts to access hidden files .abcde
location ~ /\. {
log_not_found off;
deny all;
}
# PERFORMANCE : Set expires headers for static files and turn off logging.
location ~* ^.+\.(js|css|swf|xml|txt|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bm
p|rtf)$ {
access_log off; log_not_found off; expires 30d;
}
# WORDPRESS : Rewrite rules, sends everything through index.php and keeps the appended query string intact
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
# SECURITY : Deny all attempts to access PHP Files in the uploads directory
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
# Allow only internal access to .php files inside wp-includes directory
location ~* ^/wp-includes/.*\.(php|phps)$ {
internal;
}
# REQUIREMENTS : Enable PHP Support
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
# SECURITY : Zero day Exploit Protection
# try_files $uri =404;
# ENABLE : Enable PHP, listen fpm sock
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# fastcgi_index index.php;
# include fastcgi_params;
#}
# PLUGINS : Enable Rewrite Rules for Yoast SEO SiteMap
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
[domain1]
user = domain1
group = domain1
listen = /var/run/php/php7.0-fpm-domain1.sock
listen.owner = domain1
listen.group = www-data
php_admin_value[disable_functions] = exec,passthru,shell_exec,system
php_admin_flag[allow_url_fopen] = off
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
[domain2]
user = domain2
group = domain2
listen = /var/run/php/php7.0-fpm-domain2.sock
listen.owner = domain2
listen.group = www-data
php_admin_value[disable_functions] = exec,passthru,shell_exec,system
php_admin_flag[allow_url_fopen] = off
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
Does anyone know why this issue occurs? Thanks so much!
009fd274aeae48f2bfbda6ef568676
Cloudstream Apk
Ruz
Ruz
Edward Sitarski
ebeecroft
dashan
34bcef38725b4e6eb5224ae028f17e
markatango
gouskova
Andrew J Montanus