Centos7.0 uninstall the default apache version

Source: Internet
Author: User

Centos7.0 uninstall the default apache version

After centos7.0 is installed, the apache version installed through yum is 2.4.6.

Then, the httpd service is stopped, and the default installed version is uninstalled.

Systemctl stop httpd. service

Rpm-qa | grephttpd # view the apache package and find the name (for example, httpd-2.4.6-18.el6_2.1.x86_64) use the following command to delete the rpm-ehttpd-2.2.15-15.el6_2.1.x86_64 # But first Delete the dependent apache package or yumlist | grephttpd # view the apache package name, such as httpd. x86_64yumerasehttpd.x86_64 # The dependent package is automatically deleted. Start to install 2.4.10wgethttp: // configure -- Prefix =/usr/local/aprMakeMakeinstallcdapr-util-1.5.3. /configure -- prefix =/usr/local/apr-util -- with-apr =/usr/local/aprMakeMakeinstallCd/usr/local/srcTar-xvfhttpd-2.4.10.tar.gz. /configure -- prefix =/usr/local/apache -- sysconfdir =/etc/httpd2 -- enable-so -- enable-ssl -- enable-cgi -- enable-rewrite -- with-zlib -- -pcre -- with-apr =/usr/local/apr -- with-apr-util =/usr/local/apr-util -- enable-modules = most -- enable-mpm S-shared = all -- with-mpm = event -- enable-proxy-fcgi # The parameters are: httpd installation path httpd configuration file storage path enable modular mode enable ssl Secure Connection # enable cgi Script Function enable url rewriting enable server compression enable regular expressions support apr installation path # enable common modules in the aprutil installation path to ensure that apache works properly and the multi-process model is non-static # after the event asynchronous model MakeMakeinstall is enabled, configure httpd. conf file. A small error occurred when I made the file. The path of this file is too deep, therefore, use the ln command to link to a relatively easy-to-find location ln-s/usr/local/apache/bin/httpd2/conf/usr/local/confvi/usr/local/conf/httpd. conf # AddHandlercgi-script.cgi # changed to: AddHandlerc Gi-script.cgi.pl (allowed Extension. run the CGI script of pl) AllowOverrideNone # modify it to AllowOverrideAll (allow. htaccess AddDefaultCharsetUTF-8 # modified to: AddDefaultCharsetGB2312 character # modified to: DirectoryIndexindex.htmlindex.htmDefault.htmlDefault.htm index. php (set the default homepage file and add index. php) change the servername, save, and exit, and run systemctlstarthttpd. start the httpd service and run Netstat-tnl and netstat-ntpl | grep80 find that the service is unavailable. Running/usr/local/apache/bin/apachectlstart is the same as running/usr/local/apache/bin/apachectlstop. The error message "service is not started, nohttpd. pid is cat/usr/local/apache/logs/error_logH01177: Failedtolookupprovider 'shm' for 'slotmem ': ismod_slotmem_shmloaded ?? Grep 'slotmem '/usr/local/conf/httpd. tests/mod_slotmem_shm.so/usr/local/apache/bin/apachectl-kstartnetstat-ntpl | grep: 80tcp00: 80 ::: * LISTEN7898/httpd to test apacheITISWORK. this version of apache configuration virtual host, to the configuration file put under conf/extra/, conf/extra/httpd-vhosts.conf to open httpd. conf: Remove "#" before # Includeconf/extra/httpd-vhosts.conf to let apache load virtual machine configuration file open conf/extra/httpd-vhosts.conf, hide or delete example # <VirtualHost *: 80> # Serve RAdminwebmaster@dummy-host2.example.com # DocumentRoot "/usr/local/apache2/docs/dummy-host2.example.com" # ServerNamedummy-host2.example.com # ErrorLog "logs/dummy-host2.example.com-error_log" # CustomLog "logs/dummy-host2.example.com-access_log" common # </VirtualHost> add your own note that you must add the permission <Directory/> OptionsIndexesFollowSymLinksAllowOverrideallrequireallgranted </Directory> to install PHPwgethttp: // cn2.php.net/get/php-5.5.1 7.tar.gz/from/this/mirroryuminstalllibxml2-develgd-devellibmcrypt-devellibcurl-developenssl-devel. /configure -- prefix =/usr/local/php5 -- with-apxs2 =/usr/local/apache/bin/apxs -- enable-shared -- with-libxml-dir -- with-gd -- -openssl -- enable-mbstring -- with-mcrypt -- with-mysqli -- with-mysql -- enable-opcache -- enable-mysqlnd -- enable-zip -- with-zlib-dir -- with-pdo -mysql -- with-jpeg-dir -- with-freetype-dir -- with-cur L -- without-pdo-sqlite -- without-sqlite3 loaded php module LoadModulephp5_modulemodules/libphp5.soAddTypeapplication/x-httpd-php.php.php3.php5.phtml (Note: php. there is a space in front of the php point) Create an index in the/var/www/html directory. enter the following content in php: <? Phpphpinfo ();?> Access the page to test whether PHP is successfully installed PHPWIND with winscp to copy the PHPWIND source file to the server to configure Virtual Site Vi/usr/local/conf/extra/httpd-vhosts.conf to configure a domain name PHPWIND some directories (specific name slightly) to read and write permissions, you can use winscp to set permissions, you can also command line Chomdo + wdata installation configuration phpadmin installation slightly cdphpdminchmod-R777phpMyAdmincpconfig.sample.inc.phpconfig.inc.phpviconfig.inc.phpviconfig.inc.php modify the following parameters: (if not, you can add) $ cfg ['servers'] [$ I] ['auth _ type'] = 'config '; /* Serverparameters */$ cfg ['servers'] [$ I] ['host'] = 'localhost'; $ cfg ['se Rvers'] [$ I] ['user'] = 'root'; $ cfg ['servers'] [$ I] ['Password'] = '?? '; 'Auth _ type' is used to set the login method. config directly obtains the user/password from this file and then connects to the database, http will pop up a user name and password box during client access to authenticate and process cookies. Then, the user name and password will be entered on the page to connect. Among them, the security level of config is the lowest, and the cookie level is the highest. However, if cookies are disabled, you cannot use cookies for authentication. Configure apache configuration file:/usr/local/apache/conf/extra/httpd-vhost.conf Add: <VirtualHostxxx: 80> ServerAdminxxxDocumentRoot "/usr/local/apache/htdocs/phpMyAdmin" ServerNamexxxErrorLog "logs/mysql. admin-error_log "CustomLog" logs/mysql. admin-access_log "common </VirtualHost> 9. after you restart the apache service and configure hosts, you can access the service through http: // domain name.

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.