I already have a running server with nginx at front end doing a proxy_pass to apache which is serving django.
I just want to put a simple coming-soon page for another site and found a simple PHP script to do that.
Since I've never used php, I wanted to know if there is something similar I need to do to serve the php content.
My apache sites-available for the existing domain is very simple -
`<VirtualHost *:8000>
ServerName oldDomain.com
ServerAlias www.oldDomain.com
WSGIScriptAlias / /opt/oldDomain.com/oldDomain.wsgi
</VirtualHost>`
I guess something similar for php? But what exactly? I read that php can run directly inside apache as mod_php.
My nginx config for the new site is -
`
server {
listen 80;
server_name www.NewDomain.com;
access_log /var/log/nginx/NewDomain.access.log;
error_log /var/log/nginx/NewDomain.error.log;
location / {
proxy_pass http://NewDomain.com:8000;
root /opt/NewDomain.com/public;
}
}`
EDIT Tried adding the below for the new host and it doesn't work. Hitting the new domain, takes me to the old domain.
`<VirtualHost *:8000>
ServerName NewDomain.com
ServerAlias www.NewDomain.com
# There should be something more to tell apache how to process, this this is php
</VirtualHost>`
Yes, just configure mod_php for apache. For virtual host
<VirtualHost *:8000>
ServerName NewDomain.com
ServerAlias www.NewDomain.com
# There should be something more to tell apache how to process, this this is php
DocumentRoot /path/to/folder # etc /var/www/newDomainSite/
#Nice to have logs for different virtual hosts in separate files
ErrorLog logs/newDomain-error_log
CustomLog logs/newDomain-access_log common
</VirtualHost>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.