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:

enter image description here

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 enter image description here

please let me know modifications required in conf file

you can in few different ways.

  1. putting index.html in /build

    this requires have setting:

    directoryindex index.html 

    (it should there default on platform.)

    also work, rather putting new <directory>, should put build/ directory in directory holds http://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.html 
  2. storing build/ in folder unrelated example.com, still able reach via example.com/builds

    for this, need rewrite urls example.com/builds redirects user final url. achieved through mod_rewrite. enable mod_rewrite module in apache's configuration, make sure example.com can have .htaccess files through ensuring proper allowoverride entry in example.com's <directory> configuration, create /var/www//example.com/public_html/.htaccess (or similar) file, , fill rewriteengine on , rewriterules need. more on mod_rewrite in internet , in documentation.

  3. completely separate virtual server, example builds.example.com/

    in case, you're looking virtual servers. these not defined in httpd.conf or configuration itself, have dedicated directory.

    for example, add builds.example.com works 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, can a2ensite <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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -