To install the servers, in most situations, a make install should copy the files over to the appropriate directories.
Make sure that Apache works ok. Since we configure the proxy modules statically, we don't need additional lines in there to load the proxy modules. In your case, you might need them.
We use named virtual hosts. So our setup for any given website looks like this.
Code:
<VirtualHost XX.XX.XX.XX:80>
ServerAlias www.domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /home/domain/public_html
ServerName domain.com
CustomLog /usr/local/apache/domlogs/domain.com combined
</VirtualHost> Create two directories under /home/domain/public_html for testing purposes .. we'll call them apps and static.
The static directory is where all the static files should be present (gif, css, js etc etc). These are essentially files that will be transported to the client's web browser without any alteration on the server.
For sake of experiment, create a file called logo.png in the static directory.
From the linux console or a web browser on your client computer, try and access this file.
Console:
Code:
wget http://www.domain.com/static/logo.png
or
ab http://www.domain.com/static/logo.png
If you an access the file, apache is working ok.
Now install lighttpd... with a few changes to its default configuration.
1) Modules loaded
Code:
server.modules = (
"mod_access",
"mod_simple_vhost",
"mod_deflate",
"mod_accesslog" ) We use
1) mod_simple_vhost so that lighttpd can understand handle multiple hosts.
2) mod_deflate so that we can compress some of the css and js files (as appropriate)
3) mod_accesslog to debug and test.
Port to bind on
Code:
## bind to port (default: 80)
server.port = 81
Tell ligttpd where your domain's web accessible files are.
Code:
$HTTP["host"] == "www.domain.com" { server.document-root = "/home/domain/public_html" }
Once you start lighttpd, you can test it again, using the same tools as before.
Code:
wget http://www.domain.com:81/static/logo.png
or
ab http://www.domain.com:81/static/logo.png
The difference being, you are testing the webserver on port 81.
Once the requests are successful (and check your logs to make sure there are no errors..) you now need to turn mod_proxy, in apache to redirect requests to lighttpd.