Apache, PHP installation and configuration under Windows 9x/nt (ii)

Source: Internet
Author: User
Tags aliases apache windows command line copy log parse error php file php3 file
V. Running Apache under Windows NT

If you are running a Windows NT system, you may want to run Apache as a system service process. Click the "Start" button and choose "Program", "Apache Web Server", "Insfall Apache as Service". In this way, you can manage the launch and termination of Apache through the "service" program in the NT Control Panel. Unless for special reasons, I suggest you change the "Apache Service" to "manual": Open the Control Panel, select the "Service" icon, find "Apache service", and then click "Run" to set the mode of operation to "manual". However, when you want to run Apache, you have to start it yourself, even though, when NT shuts down, Apache will automatically close, you will not see any Apache windows.

Six, running in Windows 9x

If you are using Windows 9x, I recommend that you download a copy of "Apache Manager for Windows" from the author's website. It stays in the lower-right small icon bar and hides the console window that Apache creates. This program lets you start, stop, and restart Apache directly from the annoying command line. If you don't use "Apache Manager", you should start Apache by selecting "Start", "program", "Apache webserver" and "Apache Server", which creates a console window. Don't close this window, and if you turn it off, Apache stops. To stop Apache running, you need to open an MS-DOS window and switch to the directory where you installed Apache, and execute the following command: Apache-k shutdown Apache takes a little time to close its console window. This is primarily to ensure that all processes are uninstalled and all. conf and. log files are closed. This is why the author writes Apache manager.

Seven, test your system

I strongly recommend that you run Apache at least once through the console window. The way to get Apache's run-time display information is through the control window or the Error.log file. The Error.log file is stored in the log subdirectory of the Apache installation directory. such as C:\Apache\log\error.log. OK, from "Start", "program", "Apache Webserver" select "Apache Server" to run Apache, if everything is OK, you should be able to see the information like the following:

apache/1.3.9 (WIN32) running ...

If you fail to see this message or the Apache window is fleeting, you must start Apache from the DOS window as a command line. For the directory where you installed Apache, type "Apache" to see what message was displayed. If it is "parse error in the Conf file", the problem may be on your httpd.conf. Check and fix the error.

All of them are starting to work properly. To test your system, find a browser and enter the following address: http://localhost/, you will see a page that is displayed to you by Apache, which says "It works". If this page does not appear, there may be a problem with your TCP/IP configuration, copy the Hosts.sam file from your Windows directory to the Hosts file, and check if there is a "127.0.0.1 localhost" line that is not commented out.

Next, try the php file. With your favorite codec, create a file named Info.php3 in the Htdocs subdirectory under the Apache installation directory, which reads:

<?phpinfo ();? >

Open your browser again and enter the following address: Http://localhost/info.php3. If there's no problem, you'll see a long form with PHP's various configuration information and related environment variables, including Apache. If it's not working, it's important to check that your httpd.conf settings are correct. If not, Apache will not know how to handle the. php3 file.

Viii. use of directory aliases (directory aliases)

You don't have to put everything in the Htdocs directory. In order for Apache to correctly point to the directory you want, you must edit the httpd.conf file and add the "Alias" command. It's simple, just like the following:

alias/yoursite/"c:path/to/your/web/site/"

Restart Apache, and your new directory will start working. Open the http://localhost/yoursite/with your browser. Of course, you can use your favorite name instead of "Yoursite", and then under "C:\path\to\your\website" according to your idea to build a website structure that belongs to you.




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.