Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Apache Web Server -  How to change URL default directory / webpage?

Posted on 2012-03-31
8
Medium Priority
?
450 Views
Last Modified: 2012-04-01
Hi
 
Just set up a LAMP stack. Default web page is index.html found in:
 
var/www/html
 
but I want to change it to:
 
var/www/html/web_application/index.php

Can anyone advise?

Thanks
Jason
0
Comment
Question by:Jason210
8 Comments
 
LVL 17

Accepted Solution

by:
Anuroopsundd earned 2000 total points
ID: 37790666
make the changes in /etc/apache2/httpd.conf to Document root to whatever directory you want to.
 if this file is not available then make the changes in  default-server.conf
0
 
LVL 11

Author Comment

by:Jason210
ID: 37790733
Since I'm using a machine image then the directory is slightly different:

/etc/httpd/conf/httpd.conf

In there i changed the DocumentRoot to var/www/html/moodle

Moodle is the web application folder. However, it does not seem to be working. Is there anything else that needs changing in this appache configuration file?
0
 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37790735
Did you restarted the apache services?
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37790743
just edit /sites-available/default


Quote:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
RedirectMatch ^/$ /apache2-default/
</Directory>  

and comment out #RedirectMatch ^/$ /apache2-default/

http://forums.vpslink.com/debian/496-apache2-default-how-change.html
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 37790891
# you missed the leading / in
DocumentRoot to /var/www/html/moodle
0
 
LVL 7

Expert Comment

by:Jayachandran Palanisamy
ID: 37791190
Hi,
Could you please which version of Linux that you are using and how you installed Apache(Rpm/Tar/deb)?

Jay
0
 
LVL 11

Author Comment

by:Jason210
ID: 37792974
It's deployed as an image using Amazon Web Services. The image is working fine, but I have this splash screen that I want to avoid.

So I edit the httpd.conf file by changing these lines.

DocumentRoot  "/path/to/index/page"
<Directory "/path/to/index/page">

Obviously substituting that with real information.

The funny thing is it works until I reboot the server (which I do when I make an image) and the it just craters with error 500.

This is Unbuntu 10.04, and Apache2.

@ahoffman - I didn't miss the leading slash on the conf file.
0
 
LVL 11

Author Comment

by:Jason210
ID: 37793199
It seems that it's the application that is causing this error, the index.php file in the moodle folder.

As a test, I dropped an ordinary index.html file in there it worked.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month9 days, 20 hours left to enroll

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question