4.5 Web Server
4.5.1 Creating a new site
By clicking in Insert it’s possible to create a new site. A new form is displayed (Figure 4.26) with the following fields:
Figure 4.26: Web Server - Adding sites
1. URL address: It’s the FQDN11 of the new site that will be hosted in the server. It’s possible to use SSL too. Example: www.domain.com;
11Fully Qualified Domain Name
2. Alternative URL address: Alternative name(s) for the URL address that was previously set. This field is not mandatory;
3. Site administrator email: E-Mail of the user that is responsible for the site management;
4. FTP User: A new user login that will access to the site folder through FTP.
This should be the only login and shouldn’t be equal to another IPBrick LDAP user. The site maintenance will be made through this protocol.
5. Password: Password of the FTP user.
6. Retype Password: Confirmation of Password.
7. Site folder location: Folder to be created in the server filesystem that will be automatically created on /home1/_sites/. Usually it’s used the name of the site;
8. Internet Availability: Choosing Yes we say that the virtualhost will be created from this site to the IPBrick external IP - if this is the case the created site will be available in the Internet;
9. Safe mode: If the site is php based, it deny’s the access of files outside the site folder location, so it will interfer too with the global variables. It’s the reason that the default mode is Disabled;
10. Access authorized only to the directories: By default the php have access to the site folder location and to /tmp but it’s possible to add more locations;
11. Character encoding: It’s the encoding that Apache will use for the website depending of the content language;
12. Always keep the typed URL: Allows to keep always the requested URL;
It is also necessary to create a DNS register in the company’s external DNS server forwarding to the company’s network public IP (register A or CNAME).
4.5.2 Management
When the site is created if you click on it as we can see at Figure 4.27, you have many options presented:
• Back: Allows you to go back to the main webserver menu;
• Alias;
• Redirect;
• Reverse Proxy;
4.5 Web Server 117
• Modify: Allows to modify the site fields;
• Delete: Remove the site from the web server. After clicking on Apply Configurations the site is no longer available online. The files of the site are not eliminated
but moved to the share sites_bk1. This share is the file location of the removed sites. When IPBrick removes these sites only the services that are affected are reconfigured and the contents removed to an own share accessi-ble only to LDAP Administrators. It is like in the user accounts and group shares;
Figure 4.27: Web Server - Features
Alias
Alias or Host Header is a simple form of having access to certain contents that are physically dislocated from the main directory of the site. Next we present two examples:
In Figure 4.28 example we create a web alias for the folder /home1/_sites/www/site/img.
So going to www.domain.com/es/img or www.domain.com/img will be the same.
In Figure 4.29 example we have a subsite called www.domain.com/forum that is present in filesystem at /home1/_sites/www/site/forum.
You can manage each alias if you click on it (Figure 4.30).
Figure 4.28: Web Server - Alias 1
Figure 4.29: Web Server - Alias 2
Redirect
The redirect allows you to be redirected to a new URL when you type a first URL in the browser. Some examples:
Figure 4.30: Web Server - Alias List
4.5 Web Server 119
• In Figure 4.31 example when someone try to accede to www.domain.com/index.htm (the file index.htm don’t exist), it will be automatically redirected to www.domain.com /index.htm;
• In Figure 4.32 example when someone try to accede to www.domain.com/index.html, it will be automatically redirected to www.domain.com/web/index.htm. Note
that in the source field you can insert only /index.html or www.domain.com/index.html, it’s the same.
Figure 4.31: Web Server - Redirect - Example 1
Figure 4.32: Web Server - Redirect - Example 2
You can manage each redirection if you click on it (Figure 4.33).
Reverse Proxy
The reverse proxy is used in front of the webserver and have the main goal to enable the webserver to provide content from another, in a transparent way for the users.
Figure 4.33: Web Server - Redirections List
• The first example stands for this situation: When LAN users enter the URL http://estore.domainx.com they will be transfered to a internal site run-ning in another server. So the first step is the site creation (Figure 4.34), and after that the reverse proxy definition (Figure 4.35);
• In the second example the idea is for someone in Internet that wants to accede a site running in a internal machine (http://192.168.1.4:85/cgi/site).
To do this we just need to add a new reverse proxy definition at the base domain (Figure 4.36 and Figure 4.37);
Statistics
Each site in IPBrick uses Advanced Web Statistics to display many statistics about the site accesses, the same software used for proxy statistics. To access the statistics just go to IPBrick.C - Web Server, click in the desired site and after that go to statistics.
Yo can get some useful information like you can at left side of Figure 4.38.
4.6 Webmail
The Webmail installed in IPBrick is Horde and can be configured to deal with other e-mail servers that are not IPBrick. Therefore you only have to specify in this section which IMAP12 and SMTP13 servers will be used (Figure 4.39).
To change the servers click Modify. The servers may be identified by their FQDN14 or their IP address.
12Internet Message Access Protocol
13Simple Mail Transfer Protocol
14Fully Qualified Domain Name
4.6 Webmail 121
Figure 4.34: Web Server - Reverse Proxy - Example 1 - Empty site created
Figure 4.35: Web Server - Reverse Proxy - Example 1 - Add
If we got a Intranet IPBrick (or another intranet mail server) and a Commu-nications IPBrick, you need to point the IMAP and SMTP to the internal mail server address. To use the IPBrick webmail at Internet you just need to:
• Register a A record or CNAME called webmail at the public DNS server of the company domain, pointing to the IPBrick public IP;
• If the IPBrick don’t have a public IP at eth1, configure a DNAT rule in router to the port 443 and eth1 IPBrick IP.
Figure 4.36: Web Server - Reverse Proxy - Example 2 - Add
Figure 4.37: Web Server - Reverse Proxy - Example 2 - List