Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux install Apache #165

Open
itgoyo opened this issue Jul 3, 2019 · 1 comment
Open

linux install Apache #165

itgoyo opened this issue Jul 3, 2019 · 1 comment

Comments

@itgoyo
Copy link
Owner

itgoyo commented Jul 3, 2019

1.在终端输入更新检查命令,sudo apt-get update

  1. 在更新完成后(如果不想检查更新,也可直接输入此步)输入:sudo apt-get install apache2

3.完成后,在浏览器输入https://localhost 或者127.0.0.1,如果顺利跳出Apache版本网页,即代表安装成功

4.停止服务:sudo /etc/init.d/apache2 stop

5.  Apache的默认文档根目录是在Ubuntu上的/var/www目录 ,配置文件是/ etc/apache2/apache2.conf。配置存储在的子目录在/etc/apache2目录。

//开启apache: sudo apachectl start

//重启apache: sudo apachectl restart

//关闭apache: sudo apachectl stop

Mac apache 的文件路径 /etc/apache2
DocumentRoot "/Library/WebServer/Documents"
<Directory "/Library/WebServer/Documents">
244 245行修改为
DocumentRoot "/Users/itgoyo/Documents/www"
<Directory "/Users/itgoyo/Documents/www”>
以后 apache 的根目录就是在 www 这个文件目录下
@itgoyo
Copy link
Owner Author

itgoyo commented Jul 4, 2019

如果想要 Apache 支持 php

PHP
PHP的启动只需要在Apache服务中进行一下配置即可直接使用

首先,在/private/etc/apache2目录下找到并打开httpd.conf文件

其次,搜索#LoadModule php5_module libexec/apache2/libphp5.so,将前方的#删除

有可能是 php7

/如果因为权限问题不能修改的话,把它拖到桌面修改,然后把原先的删除,之后再把桌面的拖到里面去就ok*///

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant