Configure httpd.conf to add new site on Apache Red Hat Linux -
i have linux server (red hat enterprise linux server release 5.3 (tikanga)) apache installed. used browsing documents. add new directory (with html page), whenever directory browsed can display html page.
but not sure of edit httpd.conf file
existing httpd.conf:

when hit url "http://servername/eng" displays list of folders.
now, want add website existing, when user hit url "http://servername/builds" should display html page in browser.i have added "index.html" page in location "/var/www/html/builds/"
for added below code httpd.conf file 
please let me know modifications required in conf file
you can in few different ways.
putting
index.htmlin/buildthis requires have setting:
directoryindex index.html(it should there default on platform.)
also work, rather putting new
<directory>, should putbuild/directory in directory holdshttp://example.com/files. instance:/var/www/example.com/public_html/eng/ /var/www/example.com/public_html/builds/ /var/www/example.com/public_html/builds/index.htmlstoring
build/in folder unrelatedexample.com, still able reach viaexample.com/buildsfor this, need rewrite urls
example.com/buildsredirects user final url. achieved through mod_rewrite. enablemod_rewritemodule in apache's configuration, make sureexample.comcan have.htaccessfiles through ensuring properallowoverrideentry inexample.com's<directory>configuration, create/var/www//example.com/public_html/.htaccess(or similar) file, , fillrewriteengine on,rewriterules need. more on mod_rewrite in internet , in documentation.completely separate virtual server, example
builds.example.com/in case, you're looking virtual servers. these not defined in
httpd.confor configuration itself, have dedicated directory.for example, add
builds.example.comworks port 80, you'd need create following entry:<virtualhost *:80> servername builds.example.com documentroot /var/www/builds.example.com/public_html/ </virtualhost>where put this? well, depends on platform. debian, put in new file in
/etc/apache2/sites-available/, e.g./etc/apache2/sites-available/example.com, , symlink in/etc/apache2/sites-available(on debian, cana2ensite <name_of_file>. on platform procedure might different, ("adding virtual servers on " start). after adding virtual servers, need reload apache configuration.
please let me know if satisfies question, if not, i'll edit answer accordingly.
Comments
Post a Comment