I have two applications, one is the www.myexample.com
, another is the blog.myexample.com
. I am using PHP and Apache.
Now, I want to let w
Run the following line on terminal (specify your domain and sub domain name correctly)
sudo nano /etc/apache2/sites-available/subdomain.domain.com.conf
Paste the following code and change as your requirement
ServerAdmin admin@domain.com
ServerName subdomain.domain.com
ServerAlias subdomain.domain.com
ProxyRequests Off
#ProxyPass / http://localhost:8080/
ProxyPreserveHost On
ProxyPass http://domain.com:8080/
ProxyPassReverse http://domain.com:8080/
# Uncomment the line below if your site uses SSL.
#SSLProxyEngine On
Run the following lines on terminal (specify your domain and sub domain name correctly)
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod subdomain.domain.com.conf
sudo service apache2 restart