Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hemc4/077f9510d85c7c3e3115 to your computer and use it in GitHub Desktop.
Save hemc4/077f9510d85c7c3e3115 to your computer and use it in GitHub Desktop.
Upgrade from Nginx+wordpress to Nginx->Apache + Wordpress
Stop Nignx
sudo service nginx stop
Edit nginx config
server {
listen 80;
root /usr/share/nginx/www/www.gtl.com;
index index.php index.html index.htm;
server_name www.geekstechlab.com;
location / {
try_files $uri $uri/ /index.php;
proxy_pass http://backend;
}
location ~ \.php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
location ~ /\.ht {
deny all;
}
}
sudo nano /etc/nginx/nginx.conf
add this to http
upstream backend {
ip_hash;
server 127.0.0.1:8080;
}
Install Apache
sudo apt-get install apache2
Configure Apache
sudo nano /etc/apache2/ports.conf
Change lines
NameVirtualHost 127.0.0.1:8080
Listen 127.0.0.1:8080
Create apache vhost
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/www.geekstechlab.com
sudo nano /etc/apache2/sites-available/www.geekstechlab.com
Change vhost port
<VirtualHost 127.0.0.1:8080>
Change path to
DocumentRoot /usr/share/nginx/www/www.gtl.com
sudo a2ensite www.geekstechlab.com
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo service apache2 restart
sudo service nginx restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment