云服务器配置

准备工作,登录系统

ssh 服务器ip地址 -l root

 

 

 

1,下载xampp

wget https://www.apachefriends.org/xampp-files/7.2.9/xampp-linux-x64-7.2.9-0-installer.run

 

2,安装xampp

2-1 改变文件权限为可执行

chmod 777 xampp-linux-x64-7.2.9-0-installer.run

2-2安装xampp

./xampp-linux-x64-7.2.9-0-installer.run

 

3,确认网站可访问

* 安全策略出入规则是否开放访问端口

* 是否有防火墙开启

* 服务是否正常启动 ./lampp status

 

4,配置ftp

4-1,添加用户组

groupadd 用户组名

4-2,添加用户

useradd -d /opt/lampp/www/elan -g 用户组名 -s /sbin/nologin 用户名

 

useradd -d /opt/lampp/www/xyl -g 用户组名 -s /sbin/nologin 用户名

 

4-3 创建用户密码

passwd 用户名

密码:密码

 

 

5,修改www目录下的访问权限

chmod -R 777 /opt/lampp/www/elan

chmod -R 777 /opt/lampp/www/xyl

 

备注:删除帐户的命令是userdel,修改帐户的命令是usermod,存储帐户的文件路径为/etc/passwd。

 

6,修改defaultRoot

 

vi /opt/lampp/etc/proftpd.conf

---------------------------------------

 

# only for the web servers content

 

DefaultRoot /opt/lampp/www

 

<Limit SITE_CHMOD>

DenyAll

</Limit>

 

 

<Limit LOGIN>

DenyAll

AllowGroup ftpusers

</Limit>

 

<Directory /opt/lampp/www/*>

<Limit ALL>

DenyAll

</Limit>

</Directory>

 

 

 

<Directory /opt/lampp/www/elan>

<Limit ALL>

DenyAll

AllowUser elanftp

</Limit>

</Directory>

 

<Directory /opt/lampp/www/xyl>

<Limit ALL>

DenyAll

AllowUser xylftp

</Limit>

</Directory>

 

 

# daemon gets the password "xampp"

UserPassword daemon 2TgxE8g184G9c

 

# daemon is no normal user so we have to allow users with no real shell

RequireValidShell off

 

# daemon may be in /etc/ftpusers so we also have to ignore this file

UseFtpUsers off

 

DefaultRoot ~

 

--------------------------------------

 

7,配置虚拟主机

 

7-1修改配置文件

 

vi /opt/lampp/etc/httpd.conf

 

注释掉下面内容

 

# Virtual hosts

Include etc/extra/httpd-vhosts.conf

 

 

7-2,编辑虚拟主机文件

vi etc/extra/httpd-vhosts.conf

 

------------------------------------------------

 

<VirtualHost *:80>

ServerAdmin dalian234@sina.com

DocumentRoot "/opt/lampp/www/hanying"

ServerName m.hanying.com

ServerAlias m.hanying.com

ErrorLog "logs/hanying-error_log"

CustomLog "logs/hanying-access_log" common

</VirtualHost>

<VirtualHost *:80>

ServerAdmin dalian234@sina.com

DocumentRoot "/opt/lampp/www/elan"

ServerName app.elan-fashion.com

ServerAlias app.elan-fashion.com

ErrorLog "logs/elan-error_log"

CustomLog "logs/elan-access_log" common

</VirtualHost>

 

<VirtualHost *:80>

ServerAdmin dalian234@sina.com

DocumentRoot "/opt/lampp/www/xyl"

ServerName m.xiaoyulangfood.com

ErrorLog "logs/xyl-error_log"

CustomLog "logs/xyl-access_log" common

</VirtualHost>

 

8,编辑httpd文件,配置访问权限

vi etc/httpd.conf

------------------------------------------

DocumentRoot "/opt/lampp/www"

<Directory "/opt/lampp/www">

 

 

 

9,ftp连接测试

* Encryption 使用 Only use plain FTP

* Transfer mode 使用 Active

 

10,配置ssl证书

10-1 到https://freessl.org获取免费ssl证书

10-2 在域名控制做域名解析

10-3 服务器配置

*停不掉apache可以删除文件 /opt/lampp/logs# rm httpd.pid

*安全组策略 443端口是否打开

 

10-4设置多个虚拟主机

*ServerName 需要制定具体域名

 

---------------------------------------------------

NameVirtualHost *:443

SSLStrictSNIVHostCheck off

 

<VirtualHost _default_:443>

 

# General setup for the virtual host

DocumentRoot "/opt/lampp/www/luo"

ServerName m.luoluo.store:443

ServerAdmin dalian234@sina.com

ErrorLog "/opt/lampp/logs/xyl/error_log"

TransferLog "/opt/lampp/logs/xyl/access_log"

 

# SSL Engine Switch:

# Enable/Disable SSL for this virtual host.

SSLEngine on

 

# Server Certificate:

SSLCertificateFile "/opt/lampp/etc/cert/xyl/full_chain.pem"

 

# Server Private Key:

SSLCertificateKeyFile "/opt/lampp/etc/cert/xyl/private.key"

 

 

<FilesMatch "\.(cgi|shtml|phtml|php)$">

SSLOptions +StdEnvVars

</FilesMatch>

<Directory "/opt/lampp/cgi-bin">

SSLOptions +StdEnvVars

</Directory>

 

BrowserMatch "MSIE [2-5]" \

nokeepalive ssl-unclean-shutdown \

downgrade-1.0 force-response-1.0

 

# Per-Server Logging:

# The home of a custom SSL log file. Use this when you want a

# compact non-error SSL logfile on a virtual host basis.

CustomLog "/opt/lampp/logs/ssl_request_log" \

"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

 

</VirtualHost>

 

 

 

 

 

 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
阿里云服务器配置Python的步骤如下: 1. 首先,在阿里云控制台上创建一个云服务器(ECS实例)并获取访问凭证,包括主机IP地址、用户名和密码。可以参考阿里云官方文档中的步骤来完成这一步骤。\[2\] 2. 在创建的云服务器上安装Docker。具体的安装步骤可以参考阿里云官方文档中的指引。\[2\] 3. 在本地开发环境准备Docker镜像。可以根据自己的需求选择合适的Python镜像,并在本地进行准备。\[2\] 4. 登录到阿里云服务器,可以使用SSH工具连接到服务器。然后,使用命令行界面进入服务器的操作系统。 5. 检查服务器上的Python版本。可以使用命令`python --version`来查看Python的版本信息。如果只输入`python`命令,则可能显示的是服务器自带的Python版本,比如Python 2.7。\[3\] 6. 如果需要配置特定版本的Python,可以根据自己的需求进行安装和配置。可以使用包管理工具(如pip)来安装所需的Python版本和相关的库。 总结起来,配置阿里云服务器的Python环境包括创建云服务器、安装Docker、准备本地开发环境的Docker镜像,并根据需要安装和配置特定版本的Python。\[2\]\[3\] #### 引用[.reference_title] - *1* [云上python:【一】添加服务器并搭建环境](https://blog.csdn.net/qq_42059060/article/details/111151518)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [如何将本地python项目部署到阿里云服务器上(完整版)](https://blog.csdn.net/qq_44997147/article/details/131163953)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [阿里云服务器安装配置 python(CentOS 7.6)](https://blog.csdn.net/m0_47744782/article/details/113925494)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值