通过GreenAMP架设BUGFREE后的端口修改

 

今天抽空帮朋友解决了修改PHP版本BUGFREE端口的问题,趁这机会赶紧写上来,免得以后忘了。呵呵!

 

朋友的BUGFREE因为是PHP版本,通过GreenAMP来架设。本应用这个工具的建站过程是非常简单的,可是由于某些原因需要修改端口,便花了很大时间查看源码。

 

打开GreenAMP文件夹,发现有以下几个目录,如图1。根据文件名可猜测Getting_Strated.php为启动程序的启动项,那么setPath.php则为该程序设置相关链接参数。打开Getting_Strated.php,发现里面有两段程序提示信息为“80端口已被占用,无法启动Apache”和“3306端口已被占用,无法启动MySQL”,结果很明了,803306分别为apachemysql的运行端口。再打开setPath.php文件,我们可以很快发现三段非常有用的信息。它们分别对应的文件“/Apache/conf/httpd.conf”、“/PHP/php.ini”和“/MySQL/my.ini”。



    图
1

 

接着我们逐个打开这三个文件进行分析。

 

打开“/Apache/conf/httpd.conf”,通过查找功能搜索“80”这个值,我们很快可以找到以下两段代码

1

# Listen: Allows you to bind Apache to specific IP addresses and/or

# ports, instead of the default. See also the <VirtualHost>

# directive.

#

#Listen 3000

#Listen 12.34.56.78:80

2

# Port: The port to which the standalone server listens.  Certain firewall

# products must be configured before Apache can listen to a specific port.

# Other running httpd servers will also interfere with this port.  Disable

# all firewall, security, and other services if you encounter problems.

# To help diagnose problems use the Windows NT command NETSTAT -a

#

Port 80

 

       第(1)处注释说明Apache所监听的端口或/IP地址,同时包括虚拟机的端口或/IP地址。第(2)处表示服务器将打开的端口号。将值80修改成所需要替换的端口,且监听地址为本机,如IP地址:127.0.0.1,端口:84

1

# Listen: Allows you to bind Apache to specific IP addresses and/or

# ports, instead of the default. See also the <VirtualHost>

# directive.

#

#Listen 3000

#Listen 127.0.0.1:84

2

# Port: The port to which the standalone server listens.  Certain firewall

# products must be configured before Apache can listen to a specific port.

# Other running httpd servers will also interfere with this port.  Disable

# all firewall, security, and other services if you encounter problems.

# To help diagnose problems use the Windows NT command NETSTAT -a

#

Port 84

 

       那么Apache所要修改的参数就完成了,下面修改Mysql的端口。打开“/MySQL/my.ini”,可以发现里面有两处关于端口的参数,一是关于客户端的,另一个是关于服务端的。

 

# CLIENT SECTION

# ----------------------------------------------------------------------

#

# The following options will be read by MySQL client applications.

# Note that only client applications shipped by MySQL are guaranteed

# to read this section. If you want your own MySQL client program to

# honor these values, you need to specify it as an option during the

# MySQL client library initialization.

#

[client]

 

port=3306

 

 

# SERVER SECTION

# ----------------------------------------------------------------------

#

# The following options will be read by the MySQL Server. Make sure that

# you have installed the server correctly (see above) so it reads this

# file.

#

[mysqld]

 

# The TCP/IP Port the MySQL Server will listen on

port=3306

 

两处port参数值3306修改为需要的端口,如3237

# CLIENT SECTION

# ----------------------------------------------------------------------

#

# The following options will be read by MySQL client applications.

# Note that only client applications shipped by MySQL are guaranteed

# to read this section. If you want your own MySQL client program to

# honor these values, you need to specify it as an option during the

# MySQL client library initialization.

#

[client]

 

port=3237

 

 

# SERVER SECTION

# ----------------------------------------------------------------------

#

# The following options will be read by the MySQL Server. Make sure that

# you have installed the server correctly (see above) so it reads this

# file.

#

[mysqld]

 

# The TCP/IP Port the MySQL Server will listen on

port=3237

 

       完成Mysql的修改后,打开最后一个文件“/PHP/php.ini”。发现里面的信息对我们没用,直接无视。呵呵!

       把修改后的内容保存,再双击“启动GreenAMP.bat”这个批处理文件则可大功告成。要不,你也试试?^_^

posted @ 2007-10-19 18:29  ゛無磿頭.㊣  阅读(1656)  评论(0编辑  收藏  举报