在线时间:8:00-16:00
132-9538-2358
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
由于工作须要,须要学习php,本来想安装lamp的可是考虑到如今nginxserver有良好的性能且应用广泛。 这里我决定搭建Linux(CentOS7+Nginx+MySQL+PHP)下的webserver。
这里我决定搭建Linux(CentOS7+Nginx+MySQL+PHP)下的webserver。
yum install -y httpd 安装完毕之后使用以下命令启动httpd服务: systemctl start httpd.service #启动apache systemctl stop httpd.service #停止apache systemctl restart httpd.service #重新启动apache systemctl enable httpd.service #设置apache开机启动
yum install -y httpd
systemctl start httpd.service #启动apache systemctl stop httpd.service #停止apache systemctl restart httpd.service #重新启动apache systemctl enable httpd.service #设置apache开机启动
能够在浏览器中输入server所在的主机的IP就可以看到apache的欢迎界面。 要在另外一台主机上实现这样的訪问,须要关闭系统的防火墙。
要在另外一台主机上实现这样的訪问,须要关闭系统的防火墙。
在CentOS7中,改动防火墙的机制已经做了改动,在CentOS 6.x系统中能够使用以下命令: service iptables stop chkconfig iptables off // 开机禁止启动 而在CentOS7中仅仅能使用以下命令。假设使用上面的命令并不会报不论什么错误。可是起不到关闭防火墙的效果: systemctl stop firewalld.service systemctl disable firewalld.service //禁止防火墙开机启动
service iptables stop chkconfig iptables off // 开机禁止启动
systemctl stop firewalld.service systemctl disable firewalld.service //禁止防火墙开机启动
关闭SeLinux: 使用getenforce命令能够查看SeLinux的状态,SeLinux有三种状态。分别为enforcing、permissive和disabled。 由于我们的server仅仅在内部使用。所以这里我们选择全然关闭(disabled)。 详细的做法为改动/etc/sysconfig/selinux文件,详细操作能够看里面的说明。
由于我们的server仅仅在内部使用。所以这里我们选择全然关闭(disabled)。
详细的做法为改动/etc/sysconfig/selinux文件,详细操作能够看里面的说明。
MySQL数据库。新版本号已经更名为Mariadb。所以这里须要安装Mariadb,能够使用以下的命令进行安装: yum install -y mariadb 安装完毕以后使用以下的命令开启数据库服务: systemctl start mariadb.service #启动MariaDB systemctl stop mariadb.service #停止MariaDB systemctl restart mariadb.service #重新启动MariaDB systemctl enable mariadb.service #设置开机启动
yum install -y mariadb
systemctl start mariadb.service #启动MariaDB systemctl stop mariadb.service #停止MariaDB systemctl restart mariadb.service #重新启动MariaDB systemctl enable mariadb.service #设置开机启动
使用以下的命令能够安装PHP: yum -y install php 使用以下的命令安装php对Mariadb的支持: yum install php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash 使用以下的命令重新启动Mariadb和httpd服务: systemctl restart mariadb.service #重新启动MariaDB systemctl restart httpd.service #重新启动apache
yum -y install php
yum install php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
systemctl restart mariadb.service #重新启动MariaDB systemctl restart httpd.service #重新启动apache
这里使用的是nginx做反向代理,将其client通过80port请求的.php内容代理到apacheserver上。 使用以下命令安装nginx: yum install -y nginx 要想使用nginx做反向代理,须要改动Apache的httpd和nginx的配置文件,使其监听不同的port。这里我们使用nginx监听80port,使用Apache监听8080port,这里我们分别配置Apache和nginx的配置文件,改动结果例如以下: (1)Apache配置文件:/etc/httpd/conf/httpd.conf (2)nginx配置例如以下:
使用以下命令安装nginx: yum install -y nginx 要想使用nginx做反向代理,须要改动Apache的httpd和nginx的配置文件,使其监听不同的port。这里我们使用nginx监听80port,使用Apache监听8080port,这里我们分别配置Apache和nginx的配置文件,改动结果例如以下: (1)Apache配置文件:/etc/httpd/conf/httpd.conf (2)nginx配置例如以下:
(1)不指定8080port訪问: (2)指定訪问8080port。
评论
2022-07-29
2022-08-17
2022-11-06
2022-08-12
2022-08-18
It was discovered that the IcedTea-Web used codebase attribute of the applet tag
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
monkeyboard/Wiegand-Protocol-Library-for-Arduino: Wiegand 26 and Wiegand 34 Prot
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
PureSwift/BluetoothLinux: Pure Swift Linux Bluetooth Stack
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
shem8/MaterialLogin: Login view with material design
请发表评论