Configure mutiple IBM HTTP Server / Other Apache based WEB server on 1 physical server (Section 3)

This Section will continue the actual configure for IHS related files.

3) Copy the httpd.conf file to httpd2.conf, and modify them.
 
Now Virtual IP have been added, and it‘s port 80 have been released, so we can start to do some needed configure. 
 
Firstly, copy the httpd.conf file as httpd2.conf. For Apache based server, 1 Apache server instance need 1 httpd.conf file.
 
And what we need to be configured includes:
 
PidFile logs/httpd2.pid
DocumentRoot "C:/WEB_SITE/myaddress2.com"

Listen 192.168.67.101:80
<VirtualHost 192.168.67.101:80>
...
</VirtualHost>
 
TransferLog "|bin/rotatelogs.exe C:/WEB_LOG/myaddress2.com/access.%Y%m%d.log 86400 +480"
ErrorLog "|bin/rotatelogs.exe C:/WEB_LOG/myaddress2.com/error.%Y%m%d.log 86400 +480"
 
Now, if we start a new IHS instance with this configure file, then it will be a different instance.
 
4) Create the needed folders (DocumentRoot, log folder, etc.) and add Hostname/IP entry in the hosts file (if needed).
 
Actually what we need to create is only:
 
DocumentRoot "C:/WEB_SITE/myaddress2.com"   and 
TransferLog "|bin/rotatelogs.exe C:/WEB_LOG/myaddress2.com/access.%Y%m%d.log 86400 +480"
 
And for testing purpose, we put an index.html file into the document root folder:
Configure mutiple IBM HTTP Server / Other Apache based WEB server on 1 physical server (Section 3)
 
 
After that, we‘d better add the domain of the IP into the hosts file so that we can access our website via both IP and domain name, we can define any domain name for our IP because it‘s a Internal IP.
 
File location: Windows: C:\WINDOWS\system32\drivers\etc\hosts       Linux: /etc/hosts
Configure mutiple IBM HTTP Server / Other Apache based WEB server on 1 physical server (Section 3)
 
 
5) Start the IHS/Apache service.
 
Go to the IHS home\bin folder, we will use the apache.exe to start the instance with the new httpd2.conf file.
 
Use this command to verify if the syntax of the config file is fine: apache.exe -t -f C:\IBM\HTTPServer\conf\httpd2.conf
 
Configure mutiple IBM HTTP Server / Other Apache based WEB server on 1 physical server (Section 3)
 
In order to start the service, there are some difference between Linux and Windows:
 
Linux:
This command will works: apache.exe -k start -f C:\IBM\HTTPServer\conf\httpd2.conf
 
Windows:
We need to add the new service into the Windows service manager, and then start it via the Windows service UI:
 
Firstly, add the service:
C:\IBM\HTTPServer\bin>apache.exe -k install -n "ihs-myaddress2.com" -f C:\IBM\HTTPServer\conf\httpd.conf
 
Configure mutiple IBM HTTP Server / Other Apache based WEB server on 1 physical server (Section 3)
 
Succeed! Then open services.msc, can see it have been added successfully.
Configure mutiple IBM HTTP Server / Other Apache based WEB server on 1 physical server (Section 3)
 
Right click, and click start.
Configure mutiple IBM HTTP Server / Other Apache based WEB server on 1 physical server (Section 3)
 
OK, the service have been started.
 
6) Verify if the changes works.
 
How to test? 
 
Yeah, we are configuring a website infrastructure, of course the best way is test via browser. 
 
Our web page have been displayed successfully. And you can continue to put more web pages into the document root folder.
 
Configure mutiple IBM HTTP Server / Other Apache based WEB server on 1 physical server (Section 3)
 
 
Now, start to write your own website via maybe html and JS, if want to release it to Internet, may need some port forward configure in your home router device, and that will be another toy what can be play with.
 
Enjoy it! 

Configure mutiple IBM HTTP Server / Other Apache based WEB server on 1 physical server (Section 3),布布扣,bubuko.com

Configure mutiple IBM HTTP Server / Other Apache based WEB server on 1 physical server (Section 3)

上一篇:一个生成网页验证码的类 (mycome-validate)


下一篇:保证服务器高可用性-灾难恢复(1)WEB服务器的配置流程