contos安装lnmp
来源:互联网 发布:网络语打卡的意思 编辑:程序博客网 时间:2024/06/05 19:17
1.登陆系统后使用yum安装MySQL,PHP,nginx,
yum install mysql mysql-server nginx php php-fpm
2.安装软件信息查看
rpm -ql XX(soft address)
rpm -q XX(soft version)
3.配置nginx
(1)启动nginx
service nginx restart
测试nginx是否正常启动,访问主机iP地址
(2)
启动php
service php-fpm start
查看php-fpm默认配置
cat /etc/php-fpm.d/www.conf |grep -i 'listen='
修改nginx配置
vim /etc/nginx/conf.d/default.conf
server {
listen 80;
root /usr/share/nginx/html;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
重启nginx,使配置生效
service nginx restart
(3)环境配置验证
在web目录下创建index.php
vim /usr/share/nginx/html/index.php
输出php.info()
3.配置mysql
(1)启动MySQL数据库
service mysqld start
配置MySQL为系统默认启动
chkconfig mysqld on #chkconfig设置服务为系统自动启动
登陆数据库
mysql -u root -p password
(2)配置数据库密码
mysqladmin -u root password XXX
(3)配置php支持mysql_connect()
/etc/php.ini
yum install mysql mysql-server nginx php php-fpm
2.安装软件信息查看
rpm -ql XX(soft address)
rpm -q XX(soft version)
3.配置nginx
(1)启动nginx
service nginx restart
测试nginx是否正常启动,访问主机iP地址
(2)
启动php
service php-fpm start
查看php-fpm默认配置
cat /etc/php-fpm.d/www.conf |grep -i 'listen='
修改nginx配置
vim /etc/nginx/conf.d/default.conf
server {
listen 80;
root /usr/share/nginx/html;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
重启nginx,使配置生效
service nginx restart
(3)环境配置验证
在web目录下创建index.php
vim /usr/share/nginx/html/index.php
输出php.info()
3.配置mysql
(1)启动MySQL数据库
service mysqld start
配置MySQL为系统默认启动
chkconfig mysqld on #chkconfig设置服务为系统自动启动
登陆数据库
mysql -u root -p password
(2)配置数据库密码
mysqladmin -u root password XXX
(3)配置php支持mysql_connect()
/etc/php.ini
0 0
- contos安装lnmp
- contos下安装lnmp,带详细配置信息
- contos安装laravel
- linux【ContOS】安装 mongodb
- Contos 安装tomcat
- ContOS 安装jdk
- ContOS 7.2安装
- contos 6.5 yum 安装 lamp
- contos 安装php Swoole扩展
- contOS liunx自动安装Mysql
- 在contos中安装activeMQ
- 在Contos下安装tomcat6.0.29
- 阿里云 Linux ContOS Git的安装
- Linux、ContOS下安装卸载Mysql
- contos 6.5安装PHP的curl扩展
- Linux(ContOS)下载、安装、启动、停止redis
- 安装lnmp
- LNMP安装
- 【BFS】uva11624Fire!
- 重构获取异常栈信息--printStackTrace
- C语言之动态内存分布
- UVA1508-Equipment(状态压缩+暴力枚举)
- UVa11478 - Halum(差分约束)
- contos安装lnmp
- Qt Quick 中QMessageBox Class的使用学习笔记
- Java命名和目录接口——JNDI
- C语言之函数
- Leetcode--Recover Binary Search Tree
- C++ 纯socket 模拟登录37.com【过验证码】
- Codeforces 300C Beautiful Numbers lucas求组合数逆元
- BOJ 2014新生暑假个人排位赛08 整合
- C/C++中static关键字作用总结