Managing and Maintaining a Personal or Group Apache Server

What is an Apache server?

An Apache server hosts one or more websites or webpages.

You can learn more about Apache hosting and its features at the link below.

https://service.purdue.edu/TDClient/32/Purdue/KB/ArticleDet?ID=1914

How do I request an Apache server/website for my group?

You can request an Apache server/website for your Lab/Group/Organization at the link below.

Request an Apache Site

How do I host my website on the Apache server?

Once you have an Apache server set up by Purdue IT, your entire website will be contained inside a folder hosted on the Purdue IT web server.
All you need to do is place your website files (.html, .css, .js, etc) inside the hosting folder. Below is an example of this:

Examples of whathosting looks like on the web server (Linux)

## Example 1: Website files placed inside the "public_html" folder ## 
/web/groups/<group name>/  <--- Hosting folder
-- public_html/            <--- Public webpages folder
   -- index.html           <--- Web page files (.html)
   -- schedule.html
   -- about_us.html
-- private/
-- var/

## Example 2: Website files placed directly inside the hosting folder ##
/web/entities/<group name>/  <--- Hosting folder
-- index.html                <--- Web page files (.html)
-- schedule.html
-- about_us.html

 

How do I access my hosting folder to add/edit/remove website files?

There are two ways to access your hosting folder that will contain your website files.

  • Through any SSH client (ex. SecureCRT, Shell, PuTTY)
  • By mapping the folder as a network drive in Windows

Note: When you request your hosting server, Purdue IT will provide you with credentials. You will need your
hosting account usernamepassword, and hosting folder, and host (server).

Note: In some cases, your username/password is your Purdue Career Account username/password

Note: To access your hosting account or hosting folder from off-campus may require the use of the Purdue VPN

Accessing my hosting folder through an SSH client (for users with Linux experience)

(1) Use your favorite SSH client to ssh into <username>@<host>.
(2) Enter your hosting account password
(3) Navigate to your hosting folder
(4) Add/Edit/Remove website files inside your hosting folder.

## Use SSH to login to the hosting account
$ ssh myusername@host.ecn.purdue.edu
myusername@host.ecn.purdue.edu's password: 
Last login: Thu Apr 20 15:54:03 2023 from host.ecn.purdue.edu
Linux host.ecn.purdue.edu 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
- Oracle database server downtime
On Tuesday, May 9, between 8:00pm and 8:30pm, the Oracle database servers 
will be down for patching.

## Go to your hosting directory
-bash-4.2$ cd /web/groups/<my group name>/
-bash-4.2$ ls
private public_html var
-bash-4.2$ cd public_html
-bash-4.2$ ls -lra
total 140
-rw-rw-r-- 1 group user 0 Nov 1 2017 index.html <--- Web page file (.html)
drwxrws--- 6 group user 4096 May 27 2021 ..
drwxrws--- 13 group user 4096 Nov 9 15:48 .

## Add, edit, or remove files using linux commands
-bash-4.2$ nano index.html
-bash-4.2$ cp ~/my_website/schedule.html ./
-bash-4.2$ rm about_us.html

Accessing the hosting folder by mapping it as a network drive (Windows OS)

(1) Open Dialog to Map a Network Drive

Instructions on how to map a network drive
(2) Choose any Drive: letter
(3) Use the server web.ecn.purdue.edu and your group name in the Folder: field.
It will look like \\web.ecn.purdue.edu\<group-name>
  ex. \\host.ecn.purdue.edu\mygroupname
(4) You will connect with your username and password.

An image of the Map Network Drive dialog in Windows. It shows Drive Letter 'L' selected and the folder \\host.ecn.purdue.edu\mygroupname is entered.

 

Setting a landing page for your website

When navigating to your website URL, you may notice that it shows a folder directory with your site files inside. This is the default landing page for any Apache server site.

A list of files contained at the URL displayed as a folder structure. The only file present is one called test.html.

To prevent the contents of your website folder structure from appearing, you must add a file named index.html inside your hosting folder. If Apache detects a file called index.html, it will display that page instead when someone navigates to your website URL.

After adding an index.html file to our hosting folder, the website now displays that page instead of the folder structure.

A website shows with a single h1 header that says "This is my group site with an index.html file".

Print Article

Related Services / Offerings (1)

Submit a General Support request using the "Purdue IT Request" button to the right. The Purdue IT Service Desk will examine, follow-up and route as needed.