ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
~~~ cd /usr/local/src/ wget http://apache.mirror.globo.tech/httpd/httpd-2.4.37.tar.gz tar zxvf httpd-2.4.37.tar.gz cd httpd-2.4.37 ~~~ ~~~ ./configure \ --prefix=/usr/local/apache \ --sysconfdir=/etc/httpd \ --with-apr=/usr/local/apr \ --with-apr-util=/usr/local/apr-util/bin/apu-1-config \ --with-pcre=/usr/local/pcre \ --enable--ssl \ --enable-so \ --enable-rewrite ~~~ ~~~ make && make install ~~~ ## 编辑配置文件 #在文件最后的部分,末尾加上这两句代码 ~~~ cp /etc/httpd/httpd.conf /data/config/httpd.conf vim /etc/httpd/httpd.conf PidFile "/var/run/httpd.pid" AddHandler application/x-httpd-php .php ~~~ #设置特定目录的属性 ~~~ ServerName localhost:80 <Directory "/usr/local/apache/htdocs/iooni.com"> AllowOverride All #去读取.htaccess配置文件的内容 Order allow,deny #先执行allow访问控制规则,再执行deny Allow from all #放行所有 </Directory> ~~~ example(例子): ~~~ <VirtualHost *:80> DirectoryIndex index.php index.html ServerAdmin 1422476675@qq.com DocumentRoot "/var/www/iooni.com/public" ServerName www.iooni.com ErrorLog logs/dummy-host.example.com-error_log CustomLog logs/dummy-host.example.com-access_log common </VirtualHost> ~~~ #### 启动httpd服务 ~~~ /usr/local/apache/bin/apachectl start //启动httpd服务 问题:Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80 netstat -tulnp | grep ':80' //查看被占用端口的进程 kill '进程号' ~~~ #### 开机自启 ~~~ vim /etc/rc.d/rc.local /usr/local/apache/bin/apachectl start #last line add ~~~ #### 环境变量 ~~~ vi /root/.bash_profile PATH=$PATH:$HOME/bin:/usr/local/apache/bin source /root/.bash_profile ~~~