开发者

Putting php on already running config of nginx(front)+apache(mod_wsgi)+django

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜