宝塔面板安装使用

宝塔面板 lnmp 、lamp 安装参照地址  

https://www.bt.cn/bbs/thread-19376-1-1.html    

https://www.cnblogs.com/wentutu/p/8549050.html



1、安装完lnmp的配置文件路径、默认上传网站路径

1.1 查找所有nginx路径

[root@192 ~]# find / -name nginx
/etc/rc.d/init.d/nginx
/usr/bin/nginx
/usr/local/nginx
/www/server/panel/vhost/nginx
/www/server/panel/vhost/template/nginx
/www/server/panel/rewrite/nginx
/www/server/nginx
/www/server/nginx/src/objs/nginx
/www/server/nginx/sbin/nginx


1.2  nginx主配置文件位置

/www/server/nginx/conf/nginx.conf


查看主配置文件从中查找子配置文件路径、上传网站路径

[root@192 ~]# cat /www/server/nginx/conf/nginx.conf
user  www www;
worker_processes auto;
error_log  /www/wwwlogs/nginx_error.log  crit;
pid        /www/server/nginx/logs/nginx.pid;
worker_rlimit_nofile 51200;

events
    {
        use epoll;
        worker_connections 51200;
        multi_accept on;
    }

http
    {
        include       mime.types;
        #include luawaf.conf;

        include proxy.conf;

        default_type  application/octet-stream;

        server_names_hash_bucket_size 512;
        client_header_buffer_size 32k;
        large_client_header_buffers 4 32k;
        client_max_body_size 50m;

        sendfile   on;
        tcp_nopush on;

        keepalive_timeout 60;

        tcp_nodelay on;

        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 64k;
        fastcgi_busy_buffers_size 128k;
        fastcgi_temp_file_write_size 256k;
        fastcgi_intercept_errors on;

        gzip on;
        gzip_min_length  1k;
        gzip_buffers     4 16k;
        gzip_http_version 1.1;
        gzip_comp_level 2;
        gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
        gzip_vary on;
        gzip_proxied   expired no-cache no-store private auth;
        gzip_disable   "MSIE [1-6]\.";

        limit_conn_zone $binary_remote_addr zone=perip:10m;
        limit_conn_zone $server_name zone=perserver:10m;

        server_tokens off;
        access_log off;

server
    {
        listen 888;
        server_name www.bt.cn;
        index index.html index.htm index.php;
        root  /www/server/phpmyadmin;

        #error_page   404   /404.html;
        include enable-php.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log  /www/wwwlogs/access.log;
    }
include /www/server/panel/vhost/nginx/*.conf;
}



1.2  nginx子配置文件位置

/www/server/panel/vhost/nginx

[root@192 ~]# cd /www/server/panel/vhost/nginx
[root@192 nginx]# ls
phpfpm_status.conf



1.3 默认上传网站路径

/www/wwwroot/default/



2、宝塔vhost子目录正确使用nginx配置文件

2.1 不要用vim 编辑打开子配置文件 复制内容,无法保存, 试过

2.2 用echo 写入子配置文件内容

 
  
[root@192 website]# cat /www/server/panel/vhost/nginx/test1.conf
server {
        listen 8083;
        server_name www.test1.com;
    charset    utf-8;
    location / {
    root /website;
        index index.php index.html index.htm;
        }
     
        location ~ \.php$ {
        root html;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME /website;
            include fastcgi_params;
        }

}
 
  

 3、服务器搭建网站完整教程(宝塔面板+wordpress)    


参照文档

https://www.zhujibiji.com/2018/04/how-to-use-bandwagonhost-build-a-website/


4、在宝塔后台根目录下上传网站

4.1 配置nginx子配置文件

注意:不要用vim 写入,报错,没有权限

cat >> /www/server/panel/vhost/nginx/test1.conf << EOF
server {
        listen 8083;
        server_name www.test1.com;
    charset    utf-8;
    location / {
    root /www/wwwroot/website;
        index index.php index.html index.htm;
        }
     
        location ~ \.php$ {
        root html;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME /website;
            include fastcgi_params;
        }

}
EOF



4.2、创建web站点目录、index.html

注意:web站点目录必须在/www/wwwroot/ 下创建,这就是面板的局限性

[root@192 ~]# cd /www/wwwroot/
default
[root@192 wwwroot]# mkdir website
[root@192 wwwroot]# ls
default   website
[root@192 website]# echo hello >> index.html 
[root@192 website]# ls
index.html
[root@192 website]# cat index.html 
hello


4.3、重新加载nginx

[root@192 website]# nginx -t
nginx: the configuration file /www/server/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /www/server/nginx/conf/nginx.conf test is successful



4.4、测试访问静态网页

[root@192 website]# curl http://127.0.0.1:8083
hello
 
  

 

5、在宝塔后台根目录下创建目录后,进目录里面上传网站

5.1 配置nginx子配置文件

注意:不要用vim 写入,报错,没有权限

cat >> /www/server/panel/vhost/nginx/test1.conf << EOF
server {
        listen 8083;
        server_name www.test1.com;
    charset    utf-8;
    location / {
    root /www/wwwroot/website/ceshi;
        index index.php index.html index.htm;
        }
     
        location ~ \.php$ {
        root html;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME /website;
            include fastcgi_params;
        }

}
EOF



5.2、创建web站点目录、index.html

注意:web站点目录必须在/www/wwwroot/ 下创建,这就是面板的局限性

[root@192 wwwroot]# mkdir -p /www/wwwroot/website/ceshi
[root@192 ~]# cd /www/wwwroot/website/ceshi
[root@192 ceshi]# echo hello >> index.html 
[root@192 ceshi]# ls
index.html
[root@192 ceshi]# cat index.html 
hello


5.3、重新加载nginx

[root@192 website]# nginx -t
nginx: the configuration file /www/server/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /www/server/nginx/conf/nginx.conf test is successful



5.5、测试访问静态网页

[root@192 website]# curl http://127.0.0.1:8083
hello

 
















 

转载于:https://www.cnblogs.com/effortsing/p/10031590.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
宝塔面板是一款功能强大的服务器管理面板,可以帮助用户简化服务器的管理操作。而青龙面板是基于Python开发的一款开源的京东薅羊毛工具,可以帮助用户自动化执行京东相关的任务。 要在宝塔面板安装青龙面板,可以按照以下步骤进行操作: 1. 登录宝塔面板,进入服务器管理页面。 2. 在左侧菜单栏中找到“网站”选项,点击进入网站管理页面。 3. 点击“添加站点”按钮,填写相关信息,如域名、目录等,并选择合适的PHP版本。 4. 点击“提交”按钮,等待站点创建完成。 5. 在网站管理页面找到刚创建的站点,点击“设置”按钮,进入站点设置页面。 6. 在站点设置页面中找到“SSL”选项,点击“申请SSL证书”按钮,按照提示完成SSL证书的申请和安装。 7. 安装完成后,在站点设置页面中找到“文件管理”选项,点击进入文件管理页面。 8. 在文件管理页面中找到网站根目录,进入该目录。 9. 在网站根目录中上传青龙面板安装文件,可以通过FTP或者宝塔面板提供的文件管理工具进行上传。 10. 上传完成后,在浏览器中访问你的域名,进入青龙面板安装页面。 11. 按照安装页面的提示,填写相关信息,如数据库信息、管理员账号等。 12. 点击“安装”按钮,等待安装完成。 13. 安装完成后,可以通过访问你的域名进入青龙面板,并进行相关的配置和使用。 希望以上步骤对你有所帮助!如果还有其他问题,请随时提问。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值