Logo Page Web Française
Accueil Association BSD Linux Dev Reseau Infologisme Mac OSX
tl tr
Subject Hostname Date 2008-09-16
Title Apache with the ModSecurity package Section BSD Linux
Article

Background: Linux distribution Fedora FC8 FC9

View the impressive number of fools more or less happy and malicious on the planet, up a notch security with Apache is still commendable.

With the package ModSecurity mod_security 2.1.3-1.fc8 serving on the names, Apache is not used to serve this directory for example /var/www/html/phpMyAdmin with a virtual address local 192.168.1.12 or any other IP address, Apache is used on more than the names of the Hosts file or Domain Names, which can be very unpleasant, in this case above.

It is quite simple to rectify this principle very valuable safety, it's important not to uninstall the package ModSecurity quite the contrary to keep it.


Do not attempt in any terminal with a syntax risky, to circumvent the problem!


Unfortunately much easier, all you need is a host name on the address desired:

The hosts file which is located in the folder or the directory /etc/hosts.

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1   production.site-name.com production localhost.localdomain localhost
::1         localhost6.localdomain6 localhost6
#
192.168.1.1 site-name.com www.site-name.com ftp.site-name.com mail.site-name.com
192.168.1.1 site-name.net www.site-name.net ftp.site-name.net mail.site-name.net
192.168.1.1 site-name2.com www.site-name2.com ftp.site-name2.com mail.site-name2.com
192.168.1.1 site-name2.net www.site-name2.net ftp.site-name2.net mail.site-name2.net
192.168.1.1 site-name3.com www.site-name3.com ftp.site-name3.com mail.site-name3.com
192.168.1.1 site-name3.net www.site-name3.net ftp.site-name3.net mail.site-name3.net
#
192.168.1.10 site-name
192.168.1.12 phpMyAdmin


Adding to the httpd.conf file which is located in the folder or the directory /etc/httpd/conf/httpd.conf, les lignes suivantes :

NameVirtualHost 192.168.1.1

<VirtualHost 192.168.1.12>
DocumentRoot /var/www/html/phpMyAdmin
ServerName phpMyAdmin
<Directory "/var/www/html/phpMyAdmin">
allow from all
Options +Indexes
</Directory>
</VirtualHost>



The network interfaces available.

With Webmin in section Networking then Network Configuration then Network Interfaces Add a new interface (Ethernet Virtual).
Click on eth0 with the section Active Now then on (Add virtual interface).

Repeat operation to click on eth0 Interfaces Activated at Boot Time.

 *  Broadcast address 192.168.1.255 for IP Address 192.168.1.12 /24 or Subnet Mask 255.255.255.0

You must obtain a result similar network according to the class selected.

Interfaces Active Now
Select all. | Invert selection. | Add a new interface.
 Name  Type  IP Address  Netmask  Status
eth0 Ethernet 192.168.1.1 255.255.255.0 Up
eth0:0 Ethernet (Virtual) 192.168.1.10 255.255.255.0 Up
eth0:1 Ethernet (Virtual) 192.168.1.12 255.255.255.0 Up
lo Loopback 127.0.0.1 255.0.0.0 Up
Select all. | Invert selection. | Add a new interface.
Interfaces Activated at Boot Time
Select all. | Invert selection. | Add a new interface. | Add a new address range.
 Name  Type  IP Address  Netmask  Activate at boot?
eth0 Ethernet 192.168.1.1 255.255.255.0 Yes
eth0:0 Ethernet (Virtual) 192.168.1.10 255.255.255.0 Yes
eth0:1 Ethernet (Virtual) 192.168.1.12 255.255.255.0 Yes
lo Loopback 127.0.0.1 255.0.0.0 Yes
Select all. | Invert selection. | Add a new interface. | Add a new address range.

With Webmin in section Networking then Network Configuration click this button 
to restart the network service.


In fact, to start phpMyAdmin, just type in a Web browser page http://phpMyAdmin/


For a long time I use Apache with the package ModSecurity I think this is common sense, it would seem that the meaning is not common at all ...

Author
Eric Douzet
Début de page
bl br
C-extra.com v. 1.2.0 © 2003-2010, all rights reserved  -  Updated September 02, 2010 Infologism.com