bla bla...
# Download
wget https://www.apachefriends.org/xampp-files/7.2.2/xampp-linux-x64-7.2.2-0-installer.run
# Install
chmod +x xampp-linux-x64-5.6.33-0-installer.run
sudo ./xampp-linux-x64-7.2.2-0-installer.run
sudo service nginx start
sudo service nginx restart
sudo /opt/lampp/lampp start
sudo /opt/lampp/lampp stop
sudo /opt/lampp/lampp restart
Default Xampp (Apache) and Nginx listen on port 80.
Run Nginx for serve static and proxy server for apache.
Run Apache listen on other port (eg. 8058), Nginx port 80. Nginx listen 80 and proxy to 8058 for Apache.
cd /opt/lampp/etc
sudo vim httpd.conf
# Changes:
Listen 80 -> Listen 8058
ServerName localhost -> Servername localhost:8058
sudo vim /opt/lampp/lampp
# Changes
if testport 80 -> if testport 8058
sudo /opt/lampp/lampp start
Maybe error, use:
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/mysql stop
sudo /etc/init.d/proftpd stop
Config in /etc/nginx/sites-available. Copy file default to new file (eg. apachefile) and change as:
server {
listen 80;
listen [::]:80;
server_name abc.xyz.com;
location / {
proxy_pass http://localhost:8058; # port Apache
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Soft link to sites-enable
sudo ln -s /etc/nginx/sites-availabel/apachefile /etc/nginx/sites-enable/apachefile
sudo service nginx restart
sudo netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 18009/mongod
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 28029/nginx -g daem
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1199/sshd
tcp6 0 0 :::443 :::* LISTEN 28484/httpd
tcp6 0 0 :::80 :::* LISTEN 29029/nginx -g daem
tcp6 0 0 :::21 :::* LISTEN 21283/proftpd: (acc
tcp6 0 0 :::22 :::* LISTEN 1289/sshd
tcp6 0 0 :::8058 :::* LISTEN 20684/httpd