I have built wordpress on nginx and apache2 .
1.close apache2 and start nginx.
The wordpress work when to input 127.0.0.1:8080/wp in the firefox.
Here is my nginx config file.
Code:
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
server {
listen 8080;
server_name localhost;
index index.html index.htm index.php;
root /var/www/html;
location / {
try_files $uri $uri/ /index.html;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
2.close nginx and start apache2.
The wordpress can't work when to input 127.0.0.1:8080/wp in the firefox.
Here is the apache2 config file.
cat /etc/apache2/sites-available/000-default.conf
Code:
<VirtualHost *:8080>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
cat /etc/apache2/ports.conf
Code:
Listen 8080
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
3.wordpress ownership
Code:
ls -al /var/www/html/wp
total 192
drwxr-xr-x 5 www-data www-data 4096 Sep 21 09:30 .
drwxr-xr-x 4 www-data www-data 4096 Sep 18 15:53 ..
-rwxr-xr-x 1 www-data www-data 418 Aug 10 19:56 index.php
-rwxr-xr-x 1 www-data www-data 19930 Aug 10 19:56 license.txt
-rwxr-xr-x 1 www-data www-data 7360 Sep 16 11:50 readme.html
-rwxr-xr-x 1 www-data www-data 4951 Aug 10 19:56 wp-activate.php
drwxr-xr-x 9 www-data www-data 4096 Aug 10 19:56 wp-admin
-rwxr-xr-x 1 www-data www-data 271 Aug 10 19:56 wp-blog-header.php
-rwxr-xr-x 1 www-data www-data 5007 Aug 10 19:56 wp-comments-post.php
-rwxr-xr-x 1 www-data www-data 2782 Sep 18 19:02 wp-config.php
-rwxr-xr-x 1 www-data www-data 2727 Aug 10 19:56 wp-config-sample.php
drwxr-xr-x 6 www-data www-data 4096 Sep 18 19:19 wp-content
-rwxr-xr-x 1 www-data www-data 3115 Aug 10 19:56 wp-cron.php
drwxr-xr-x 12 www-data www-data 4096 Aug 10 19:56 wp-includes
-rwxr-xr-x 1 www-data www-data 2380 Aug 10 19:56 wp-links-opml.php
-rwxr-xr-x 1 www-data www-data 3123 Aug 10 19:56 wp-load.php
-rwxr-xr-x 1 www-data www-data 34241 Aug 10 19:56 wp-login.php
-rwxr-xr-x 1 www-data www-data 8252 Aug 10 19:56 wp-mail.php
-rwxr-xr-x 1 www-data www-data 11048 Aug 10 19:56 wp-settings.php
-rwxr-xr-x 1 www-data www-data 25152 Aug 10 19:56 wp-signup.php
-rwxr-xr-x 1 www-data www-data 4035 Aug 10 19:56 wp-trackback.php
-rwxr-xr-x 1 www-data www-data 3032 Aug 10 19:56 xmlrpc.php
Why wordpress can work only on nginx but not apache2 ?