Install Apache for Linux server dongle

Source: Internet
Author: User
Note:

Use the yum command in CentOS to install the httpd version by default. It is no problem to directly install the Apache version of the server security dog.

However, if Apache is a custom path and the module is added for compilation and installation, an error is reported when the Apache version of the server security dog is installed by default, prompting that the installation fails.

 

 

Httpd-2.2.31

 

Php-5.2.17

 

Note: consultation security dog official staff to get a response is php version is too low, high version of php directly installed will not be a problem, here is the version of the php-5.2.17, other versions have not tried.

 

Solution:

 

1. Download dongle

 

Cd/usr/local/src

 

Wget http://safedog.cn/safedog_linux64.tar.gz # Download dongle 64-bit version

 

Tar zxvf safedog_linux64.tar.gz # decompress

 

Cd/usr/local/src/safedog_linux64/install_files/safedogwz_linux64 # enter the Directory

 

Vi install. sh # Edit and modify. Comment out the function find_apache () and function clean_install () modules.

 

# Find apache
# Function find_apache ()
#{
# For progname in httpd apache2 apached
# Do
# Find apache service
# Testcmd = "service" $ progname "status"
# $ Testcmd>/dev/null 2> & 1
# Ret = $?
# If ["$ ret" = "0"] | ["$ ret" = "2"] | ["$ ret" = "3"]; then
# G_ExistApache = "true"
# G_ApacheExePath = $ progname
# G_ApacheRestartCmd = "service" $ progname "restart"
# G_ApacheReloadCmd = "service" $ progname "graceful"
# G_ApacheStopCmd = "service" $ progname "stop"
# G_ApacheExeName = $ progname
# Get_apache_confpath
# If [! -Z $ g_ApacheConfPath]; then
# Return 1
# Fi
# Else
# Testcmd = "service" $ progname "stop"
# $ Testcmd>/dev/null 2> & 1
# Ret = $?
# If ["$ ret" = "0"]; then
# G_ExistApache = "true"
# G_ApacheExePath = $ progname
# G_ApacheRestartCmd = "service" $ progname "restart"
# G_ApacheReloadCmd = "service" $ progname "graceful"
# G_ApacheStopCmd = "service" $ progname "stop"
# G_ApacheExeName = $ progname
# Get_apache_confpath
# If [! -Z $ g_ApacheConfPath]; then
# Return 1
# Fi
# Fi
# Fi
#
# "Find apache process"
# G_ApacheExePath = 'PS-ef | grep $ progname | grep-v grep | tail-3 | head-1 | awk '{print $8 }''
# If [! -Z $ g_ApacheExePath]; then
# G_ExistApache = "true"
# G_ApacheRestartCmd = $ g_ApacheExePath "-k restart"
# G_ApacheReloadCmd = $ g_ApacheExePath "-k graceful"
# G_ApacheStopCmd = $ g_ApacheExePath "-k stop"
# G_ApacheExeName = $ progname
# Return 1
# Fi
#
# Done
#
# Not found
# G_ExistApache = "false"
#}

 

# Function clean_install ()
#{
#./Uninstall. sh 1>/dev/null 2> & 1
#}

 

: Wq! # Save and exit

 

2. Install dongle

 

Cd/usr/local/src/safedog_linux64

 

Chmod + x *. py # Add execution permission

 

./Install. py # install

 

The path of the apache module is required during installation.

 

/Usr/local/apache/bin

 

3. Set the apache configuration file

 

Vi/usr/local/apache/conf/httpd. conf # Edit

 

# Begin SafeDogSite-ApacheFilter edits-remove only on uninstall

 

Include "/etc/safedog/apache/SafeDogSiteApacheFilter. Conf"

 

LoadModule php5_module modules/libphp5.so # find this line in the configuration file and move it to the bottom of the dongle configuration file

 

Service httpd restart # restart apache

 

 

Service safedog status # view the dongle status

 

Service safedog start # start

 

Service safedog stop # stop

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.