Separating machines between WebServer and the code server is kind of easy.
Basic knowledges you have to know is about httpd.conf, networkfilesystem, fstab, and user-group id
NetworkFileSystem is the one we will use to share the directory from the code server.
First : See your httpd.conf files for each VirtualHost directives, you will find DocumentRoot for each VirtualHosts.
These VirtualHosts are all the domains/hosts absolute path on unix style.
example :
<VirtualHost *:80>
ServerAdmin admin@domainnameyahoo.info
DocumentRoot /var/www/html/domannameyahoo.info
ServerName domainnameyahoo.info
ServerAlias www.domainnameyahoo.info
ErrorLog /var/log/httpd/domainnameyahoo.info-error_log
CustomLog /var/log/httpd/domainnameyahoo.info-access_log common
DirectoryIndex default.php index.php index.html
</VirtualHost>
Next, make sure you have php/html code in your code server.
Then start to mount the code server as follow :
# mount -t nfs -o rw 192.168.1.10:/var/www/html/domainnameyahoo.info /var/www/html/domainnameyahoo.info
note : 192.168.1.10 is your code_server ip address
June 18th, 2009
Posted by
admin |
Apache, CentOS, Ubuntu |
no comments
Generally, people put together between the WebServer (httpd services) with php code.
For economic sakes , yes you may put it that way. No other choice.
But for easy maintenance and more security better you put WebServer and php code in separated machine even the Database server is also separated.
With this way you can create Web Server load balancing, or any backup Web Server.
Things you have to know is around linux file sharing ( i am going to use nfs as file sharing ) and some security on firewall to keep the code and database more secure.
This time, I put 1 little machine which will act as webserver.
I will tell you all the step by step about it.
June 4th, 2009
Posted by
admin |
Apache, CentOS, General, Ubuntu |
no comments
Web server and File server is good to be placed on different machine.
In my case, I have web server running apache+php+mysql under Centos Box, and File Server is on Windows Advanced Server 2000. The problem is apache cannot read the php file in Windows server.
All I have done :
- I added line at fstab configuration
//192.168.1.3/data/media/code cifs username=administrator,password= 0 0
- I edit httpd.conf as below
EnableMMAP off
EnableSendfile off
That’s all, and only that. Many people pay for this solution, But I gave you FREE !!.
April 14th, 2009
Posted by
admin |
Apache, CentOS, Samba, Ubuntu, Windows |
no comments