Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2012-03-31
Medium Priority
Last Modified: 2012-04-01
Just set up a LAMP stack. Default web page is index.html found in:
but I want to change it to:

Can anyone advise?

Question by:Jason210
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 17

Accepted Solution

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
LVL 11

Author Comment

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


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?
LVL 17

Expert Comment

ID: 37790735
Did you restarted the apache services?
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

LVL 17

Expert Comment

ID: 37790743
just edit /sites-available/default

<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/

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

Expert Comment

ID: 37790891
# you missed the leading / in
DocumentRoot to /var/www/html/moodle

Expert Comment

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

LVL 11

Author Comment

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.
LVL 11

Author Comment

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.

Featured Post

PowerShell Core for Advanced Linux Administrators

Understand advanced principals around Powershell Core with a focus on the Linux Administrator.  This course covers how to administer numerous environments across multiple platforms including Linux, Azure, AWS, and Google Cloud from a single shell instance.

Question has a verified solution.

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

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

721 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