Enable Apache service under HP-UX

Source: Internet
Author: User
Open the Apache service under the HP-UX-Linux Enterprise Application-Linux server application information, the following is read details. Apache is a Web server software that is currently in the process of comparison. Its open source code, ease of use, and cross-platform advantages make more and more people like it.

Next let's take a look at how to enable the Apache service on the HP-UX operating system.

1. Check whether Apache software is installed.
# Swlist-l bundle | grep-I Apache
HpuxwsApache B .2.0.55.03 HP-UX for Apache-based Web Server

This indicates that the Apache Software has been installed. The version is 2.0.55.03. If not, you can download it from the official site of www.apache.org.

2. Enable the Apache service
In general, Apache is already installed in a variety of operating systems, HP-UX operating systems are no exception-unless the software is removed when the operating system is installed.

2.1 modify the/etc/rc. config. d/hpws_apacheconf File

Change HPWS_APACHE_START = 0 to HPWS_APACHE_START = 1.

The default value of this file is as follows:

# Apache Web Server configuration file
# Set HPWS_APACHE_START to 1 to have the Apache web-server started by
# Init process.
HPWS_APACHE_START = 0
HPWS_APACHE_START_SSL = 0

# Set HPWS_APACHE_HOME to the location of the Apache web-server.
# Default is/opt/hpws/apache
HPWS_APACHE_HOME =/opt/hpws/apache

2.2 run the Apache service

#/Sbin/rc3.d/S823hpws_apache start

NOTE: If/etc/rc is not modified. config. if you run the d/hpws_apacheconf file, an error is returned. If you modify the HPWS_APACHE_START parameter through HTTP or HTTPS, modify the HPWS_APACHE_START_SSL parameter. In any case, only one of these two parameters can be modified, or an error will be reported-this error is very easy to locate and clearly indicated in the error description. We recommend that you modify the configuration according to the error to familiarize yourself with the error message, which will be helpful for Troubleshooting in the future.

OK, now you can find any Client-as long as the machine can access the IP address of this HP-UX server and port 80 is open, then open a Web browser, enter the IP address of the HP-UX to see ...... the page displayed here is the page when Apache is enabled by default. Of course, this is not enough because Web servers are used to display our own Web pages.

Then, we will continue to configure Apache to meet our own needs.

To enable it to run my own web page, I disable the Apache service first:

#/Sbin/rc3.d/S823hpws_apache stop

In addition, I did the following two tasks:

A. Create a user (of course this is not necessary. You can use the root user, but the security is reduced)

# Useradd-d/home/crystal-m-s/bin/sh-u 2007-g other-c Crystal. Chen crystal
# Passwd crystal

B. Create a basic web page index.html for testing.

The webpage content is as follows:





Crsytal. Chen's Apache test index










This is only a test.





In fact, This is only a test. Others are descriptions of various formats of HTML web pages. For more information, see the HTML syntax.

After creating the above files, I will place them in the/home/crystal/Private_Web/HTML directory. This directory is used as the main directory of Apache Web.

3. Modify the httpd. conf file
This file is an Apache configuration file. In the old version, you need to modify multiple files. In Versions later than 1.5, you only need to modify this configuration file, which is very convenient. The directory in this configuration file is/opt/hpws/apache/conf -- check/etc/rc. config. d/hpws_apacheconf and you will understand it.

3.1 modify DocumentRoot "/opt/hpws/apache/htdocs"
I changed it to DocumentRoot "/home/crystal/Private_Web/HTML"

3.2 modify
I changed

4. Restart the Apache service.
#/Sbin/rc3.d/S823hpws_apache start

OK. Refresh the webpage. What do you see? Isn't "This is only a test." coming slowly? If you see this, congratulations, your configuration is successful.

Note: This article only teaches you how to start the Apache service. As for how to add the PHP module to Apache to support CGI programs, we will introduce it later in detail. The optimization of Apache is also very important. Let's take a look at the instructions in httpd. conf, which is very helpful for the optimization.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.