日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

CentOS在安装配置 Ngnix_tomcat_PHP_Mysql

發布時間:2025/4/14 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CentOS在安装配置 Ngnix_tomcat_PHP_Mysql 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

安裝Nginx

yum install nginx
假設顯示找不到 nginx包,新建一個文件/etc/yum.repos.d/nginx.repo,內容: [nginx] name=nginx repo baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/ gpgcheck=0 enabled=1
當中:OS替換成centos或者rhel,依據你安裝的發行版版本號?OSRELEASE替換成5,6或者7,分別相應著5.想,6.x,7.x 如: [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/6/$basearch/ gpgcheck=0 enabled=1 ~刪除之前的httpd yum remove httpd
安裝 yum install ngnix
推斷conf /usr/sbin/nginx -t
啟動: service nginx restart
增加自啟動 chkconfig --levels 235 nginx on

安裝PHP

yum install php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap php-tidy

vi /etc/php.ini

在文件末尾加入cgi.fix_pathinfo = 1

啟動php-fpm:
service php-fpm startphp-fpm增加啟動項:
chkconfig --levels 235 php-fpm on

安裝Tomcat

下載解壓到/usr/local/tomcat port改為8090 啟動就可以

安裝mysql:

yum install mysql mysql-server 設置password: mysql>use mysql; mysql>update user set password=password('你的密碼') where user='root'; mysql>flush privileges;
改動password:grant all on *.* to 'root'@'localhost' IDENTIFIED BY '你的password'with grant option ; flush privileges

配置Nginx:

進入/etc/nginx 新建一個文件: proxy.conf:
proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k;
進入:/etc/nginx/conf.d 新建tomcat.conf server {listen 8080;server_name localhost;#charset koi8-r;#access_log /var/log/nginx/log/host.access.log main;location / {#root /usr/share/nginx/html;index index.html index.htm;proxy_pass http://127.0.0.1:8090/;}#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$ {# root html;# fastcgi_pass 127.0.0.1:9000;# fastcgi_index index.php;# fastcgi_param SCRIPT_FILENAME /scripts$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配置完畢
配置default.conf(也能夠新建一個): server {listen 80;server_name localhost;#charset koi8-r;#access_log /var/log/nginx/log/host.access.log main;location / {#root /usr/share/nginx/html;root /var/www/html;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$ {root html;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;#} }

重新啟動就可以 也能夠平滑重新啟動:/usr/sbin/nginx -t -c /etc/nginx/nginx.conf
注:

chkconfig?使用范例:
chkconfig --list??????? #列出全部的系統服務
chkconfig --add httpd??????? #添加httpd服務
chkconfig --del httpd??????? #刪除httpd服務
chkconfig --level httpd 2345 on??????? #設置httpd在執行級別為2、3、4、5的情況下都是on(開啟)的狀態
chkconfig --list??????? #列出系統全部的服務啟動情況
chkconfig --list mysqld??????? #列出mysqld服務設置情況
chkconfig --level 35 mysqld on??????? #設定mysqld在等級3和5為開機執行服務,--level 35表示操作僅僅在等級3和5執行。on表示啟動,off表示關閉
chkconfig mysqld on??????? #設定mysqld在各等級為on,“各等級”包含2、3、4、5等級

怎樣添加一個服務:
1.服務腳本必須存放在/etc/ini.d/文件夾下。
2.chkconfig --add servicename
??? 在chkconfig工具服務列表中添加此服務,此時服務會被在/etc/rc.d/rcN.d中賦予K/S入口了;
3.chkconfig --level 35 mysqld on
??? 改動服務的默認啟動等級。



版權聲明:本文博客原創文章,博客,未經同意,不得轉載。

轉載于:https://www.cnblogs.com/blfshiye/p/4622882.html

總結

以上是生活随笔為你收集整理的CentOS在安装配置 Ngnix_tomcat_PHP_Mysql的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 香蕉视频在线免费播放 | 91亚洲欧美 | 涩涩网站在线观看 | 少妇15p| 亚洲天堂av一区二区 | 性――交――性――乱睡觉 | 91福利视频导航 | 亚洲AV午夜精品 | 国产黄色电影 | 午夜激情在线观看 | youjizz国产精品 | 国产一区二区三区四区五区在线 | 蜜色影院 | 久久网站免费观看 | 夫妻性生活自拍 | 国产女人18毛片 | 成人片免费看 | 国产主播第一页 | 成年人的黄色片 | 91娇羞白丝 | 中文字幕在线不卡 | 成年人免费网站 | 黄色特级毛片 | 欧美色综合 | 亚洲在线成人 | 亚洲国产成人va在线观看天堂 | 国内一区二区视频 | 免费成人美女在线观看. | 美女干b视频 | 国产伦人伦偷精品视频 | 欧美噜噜噜 | 婷婷四房综合激情五月 | 一级不卡毛片 | 日韩欧美视频免费在线观看 | 中文字幕无码人妻少妇免费 | 精品国产鲁一鲁一区二区三区 | 美女扒开粉嫩尿口 | 一区二区在线观看av | 亚洲欧洲一区二区 | 9l视频自拍九色9l视频成人 | 伊人手机在线视频 | 国产视频观看 | 亚洲av无码一区二区三区人妖 | 国产视频福利在线 | 亚欧成人精品一区二区 | 久久不射视频 | 中文在线а√天堂官网 | 欧美国产视频一区 | 女人洗澡一级特黄毛片 | 欧美日韩国产在线观看 | 欧美aⅴ | 亚洲热av| www五月| 午夜在线不卡 | julia一区| 午夜激情在线观看视频 | 亚洲精品国产一区二 | wwwjavhd| 91天天操| 800av在线视频 | 国产剧情精品在线 | 麻豆成人在线 | 久久久久一区二区精码av少妇 | 色播五月综合 | 欧美自拍偷拍一区二区 | 五月天综合在线 | 中文字幕精品三级久久久 | 2022av在线| 国产精品自拍av | 中文字幕无线码一区 | 亚洲av无码一区二区三区在线播放 | 黄色a视频 | 亚洲成a人片在线 | 色婷婷中文| 欧美精品久久96人妻无码 | av色先锋 | 欧美粗暴se喷水 | 高清在线一区二区 | 欧美午夜精品 | 亚洲色图 欧美 | 91日韩视频 | 亚洲一区二区在线看 | 波多野结衣在线播放 | 99久久久国产精品 | 性欧美又大又长又硬 | 超碰91在线 | 新婚夫妇白天啪啪自拍 | 国产一区资源 | 久久国内偷拍 | 九九久久网 | 依依成人在线视频 | 97黄色网 | 天天免费视频 | 欧美一级特黄aa大片 | 日本视频三区 | 国产一级视频在线观看 | 久久黄色网 | 久久久久亚洲av成人网人人软件 | 1024手机在线看片 |