Apache, PHP在Windows 9x/NT下的安装与配置 (二)
如果你运行的Windows NT系统,你可能要将Apache作为系统的服务进程来运行。点击“开始”按钮,选择“程序”,“Apache Web Server”,“Insfall Apache as Service”。这样,你可以通过NT的控制面版中的“服务”程序来管理Apache的启动和终止。除非有特殊的理由,我建议你将“Apache Service”的运行方式改为“手动”:打开控制面版,选择“服务”图标,找到“Apache Service”,再点击“运行”,将运行方式设为“手动”。不过这样,当你要运行Apache时,必须亲自去启动它,虽然如此,在NT关闭时,Apache也会自动关闭,你不会看到任何Apache的窗口。
六、在Windows 9x中运行
如果你用的是Windows 9x,那么我建议你从作者的网站下载一份“Apache Manager for Windows”。它运行时停留在而右下方小图标栏中,并且会隐藏Apache创建的控制台窗口。这个程序让你避开讨厌的命令行直接启动、停止、重新启动Apache。如果你不用“Apache Manager”,你应通过选择“开始”,“程序”,“Apache webserver”及“Apache Server”来启动Apache,这样会创建一个控制台窗口。千万别关闭这个窗口,如果关掉,Apache就停止了。要停止Apache的运行,你要打开一个MS-Dos窗口,换到你的安装Apache的目录中,执行如下命令: apache -k shutdown Apache要花一点时间来关闭它的控制台窗口。这主要是为了确保卸载所有的进程,关闭所有的.conf和.log文件。这也正是作者编写Apache Manager的原因。
七、测试你的系统
我强烈建议你至少通过控制台窗口运行Apache一次。要想得到Apache的运行时显示信息的办法是通过控制窗口或error.log文件。error.log文件存放在Apache安装目录的log子目录内。如 c:\Apache\log\error.log。 好,从“开始”,“程序”,“Apache Webserver”中选择“Apache server”运行Apache,如果一切都ok的话,你应该能看到像下面的信息:
Apache/1.3.9(Win32) running...
如果你未能看到这条消息或Apache窗口稍纵即逝,你就必须从Dos窗口以命令行的方式启动Apache。换到你安装Apache的目录,键入"Apache",看看显示了什么消息。如果是“parse error in the conf file”,问题可能出在你的httpd.conf上。检查一下,并修正错误。
所有的都开始正常工作了。要测试你的系统,找开浏览器,输入如下地址:http://localhost/,你会看到一个由Apache显示给你的页面,上面写着“It works”之类的话。如果未出现这一页,可能你的TCP/IP配置有问题,将你的Windows目录里的hosts.sam文件复制为hosts文件,并检查是否有“127.0.0.1 localhost”一行,并且没有被注释掉。
接下来,试试PHP文件。用你喜爱的编输器,在APache安装目录下的htdocs子目录中创建一个名为info.php3的文件,内容如下:
再打开你的浏览器,输入如下地址:http://localhost/info.php3。如果没有问题的话,你会看到一张很长的表格,里面有PHP的各种配置信息及相关的环境变量,包括Apache的。如果它未工作,请检查你的httpd.conf的设置是否正确,这很重要。如果未设置好,Apache将不知道如何去处理.php3的文件。
八、使用目录别名(Directory Aliases)
你大可不必将所有的东西放到htdocs 目录中。为了能让Apache正确指到你想要的目录,你必须编辑httpd.conf文件,增加"Alias"指令。很简单,就像下面这样:
Alias /yoursite/ "c:path/to/your/web/site/"
重新启动Apache,你新建的目录就开始工作了。用你的浏览器打开http://localhost/yoursite/。当然,你完全可以用你喜欢的名字代替“yoursite”,然后在“c:\path\to\your\website”下面按照你的想法建立一个属于你自己的网站结构。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The steps to start Apache are as follows: Install Apache (command: sudo apt-get install apache2 or download it from the official website) Start Apache (Linux: sudo systemctl start apache2; Windows: Right-click the "Apache2.4" service and select "Start") Check whether it has been started (Linux: sudo systemctl status apache2; Windows: Check the status of the "Apache2.4" service in the service manager) Enable boot automatically (optional, Linux: sudo systemctl

To set up a CGI directory in Apache, you need to perform the following steps: Create a CGI directory such as "cgi-bin", and grant Apache write permissions. Add the "ScriptAlias" directive block in the Apache configuration file to map the CGI directory to the "/cgi-bin" URL. Restart Apache.

There are 3 ways to view the version on the Apache server: via the command line (apachectl -v or apache2ctl -v), check the server status page (http://<server IP or domain name>/server-status), or view the Apache configuration file (ServerVersion: Apache/<version number>).

When the Apache 80 port is occupied, the solution is as follows: find out the process that occupies the port and close it. Check the firewall settings to make sure Apache is not blocked. If the above method does not work, please reconfigure Apache to use a different port. Restart the Apache service.

To delete an extra ServerName directive from Apache, you can take the following steps: Identify and delete the extra ServerName directive. Restart Apache to make the changes take effect. Check the configuration file to verify changes. Test the server to make sure the problem is resolved.

This article describes how to adjust the logging level of the ApacheWeb server in the Debian system. By modifying the configuration file, you can control the verbose level of log information recorded by Apache. Method 1: Modify the main configuration file to locate the configuration file: The configuration file of Apache2.x is usually located in the /etc/apache2/ directory. The file name may be apache2.conf or httpd.conf, depending on your installation method. Edit configuration file: Open configuration file with root permissions using a text editor (such as nano): sudonano/etc/apache2/apache2.conf

This article discusses how to improve Hadoop data processing efficiency on Debian systems. Optimization strategies cover hardware upgrades, operating system parameter adjustments, Hadoop configuration modifications, and the use of efficient algorithms and tools. 1. Hardware resource strengthening ensures that all nodes have consistent hardware configurations, especially paying attention to CPU, memory and network equipment performance. Choosing high-performance hardware components is essential to improve overall processing speed. 2. Operating system tunes file descriptors and network connections: Modify the /etc/security/limits.conf file to increase the upper limit of file descriptors and network connections allowed to be opened at the same time by the system. JVM parameter adjustment: Adjust in hadoop-env.sh file

Apache connects to a database requires the following steps: Install the database driver. Configure the web.xml file to create a connection pool. Create a JDBC data source and specify the connection settings. Use the JDBC API to access the database from Java code, including getting connections, creating statements, binding parameters, executing queries or updates, and processing results.
