Creation of sample zone in Solaris for hosting apache, part 2

For next example let's create another zone, named apache2, but this time we will use apache server from Solaris and config file from previous zone

# cp /zones/apache-zone.cfg /zones/apache2-zone.cfg

  • edit file and change zonepath and IP address
  • next will use this config file to initialize new zone

# zonecfg -z apache2 -f /zones/apache2-zone.cfg
# zoneadm -z apache2 install
# zoneadm -z apache2 boot

  •     add own users w3 with group w3 and create and edit config file. Do not forget to change IP address apache will listen and /etc/hosts for FQDN of host

# cp /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf
# groupadd w3
# useradd -g w3 w3


  •     create directory /var/run/apache2, because it do not exist, but it's need to keep apache pid file or make some changes in apache config file

mkdir -p /var/run/apache2


  •     start server and test if it's work

# /usr/apache2/bin/apachectl start
# ps -efl|grep http
0 S     root  4520  4062   0  50 20 dbbabae0    253 d6860820 09:44:33 pts/2       0:00 grep http
0 S       w3  4516  4513   0  40 20 dbbaaa20   1456 d5465384 09:44:23 ?           0:00 /usr/apache2/bin/httpd -k start
0 S     root  4513  3924   0  40 20 dbba9100   1421 d5ebbd16 09:44:22 ?           0:00 /usr/apache2/bin/httpd -k start
0 S       w3  4517  4513   0  40 20 e8df5ae8   1456 d5465384 09:44:23 ?           0:00 /usr/apache2/bin/httpd -k start
0 S       w3  4518  4513   0  40 20 e8df5288   1456 d5465384 09:44:23 ?           0:00 /usr/apache2/bin/httpd -k start
0 S       w3  4514  4513   0  40 20 e8df4a28   1456 d5465384 09:44:23 ?           0:00 /usr/apache2/bin/httpd -k start
0 S       w3  4515  4513   0  40 20 e8df41c8   1456 d5465384 09:44:23 ?           0:00 /usr/apache2/bin/httpd -k start

# telnet 192.168.30.101 80
Trying 192.168.30.101...
Connected to 192.168.30.101.
Escape character is '^]'.
get
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>501 Method Not Implemented</title>
</head><body>

Method Not Implemented

get to /index.html.en not supported.

<address>Apache/2.0.55 (Unix) DAV/2 Server at 192.168.30.101 Port 80</address>
</body></html>
Connection to 192.168.30.101 closed by foreign host.


    and now we have 2 zones and 2 different web servers

No comments:

Post a Comment

Compressed tar archive

There are some cases when you want to create compressed tar archive but you do not have enough disk space to keep original files and tar arc...