From 44360092d8f4cf5d0ef5fdd70b53210529318120 Mon Sep 17 00:00:00 2001 From: "Xu, Shunxuan" Date: Fri, 29 Jan 2016 16:43:22 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE234=E7=9A=84ftp=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E7=9A=84=E5=9F=9F=E5=90=8D=E7=AD=89=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改: README.md 新文件: apache-config-second-header.md Signed-off-by: Xu, Shunxuan --- README.md | 2 + apache-config-second-header.md | 287 +++++++++++++++++++++++++++++++++ 2 files changed, 289 insertions(+) create mode 100644 apache-config-second-header.md diff --git a/README.md b/README.md index e430858..a3474de 100644 --- a/README.md +++ b/README.md @@ -24,3 +24,5 @@ ## [linx6.0.42.41自动编译服务器搭建](Auto-Builder-Server.md) +## [ftp域名服务器配置](apache-config-second-header.md) + diff --git a/apache-config-second-header.md b/apache-config-second-header.md new file mode 100644 index 0000000..87a5859 --- /dev/null +++ b/apache-config-second-header.md @@ -0,0 +1,287 @@ +# 配置ftp服务器 + +## 配置二级域名(Apache域名服务器) + +示例: + +配置“172.16.0.234”的域名为“mirrors.rd.in.linx” + +配置“172.16.0.234/TechnicalSupport-log/logs"的域名为”tslog.rd.in.linx“ + +### 安装apache服务包 + +注意apache2服务包要从debian源里下载安装。 + +可使用如下命令查找及安装: + +``` +aptitude search apache2 +aptitude install apache2(可能也有别的服务依赖包,此处不做详述) +``` + +安装后,启动服务/etc/init.d/apache2 start + +查看服务启动后的进程(主要查看服务运行的用户),示例如下: + +``` +root@mirrors:/etc/apache2# ps aux | grep apache +root 25188 2.3 0.7 171952 14272 ? Ss 13:51 0:00 /usr/sbin/apache2 -k start +www-data 25196 0.0 0.4 171952 8632 ? S 13:51 0:00 /usr/sbin/apache2 -k start +www-data 25197 0.0 0.4 171952 8632 ? S 13:51 0:00 /usr/sbin/apache2 -k start +www-data 25198 0.0 0.4 171952 8632 ? S 13:51 0:00 /usr/sbin/apache2 -k start +www-data 25199 0.0 0.4 171952 8632 ? S 13:51 0:00 /usr/sbin/apache2 -k start +www-data 25200 0.0 0.4 171952 8632 ? S 13:51 0:00 /usr/sbin/apache2 -k start +root 25202 0.0 0.0 7760 840 pts/1 S+ 13:51 0:00 grep apache +``` + +### 配置域名及二级域名 + +#### 配置一级域名 + +修改apache配置文件/etc/apache2/sites-available/default,在的配置中添加一行”HeaderName footer.html“。(即当访问到此apache服务器时,会读取/var/www/footer.html配置文件) + +配置文件如下: + +``` + +root@mirrors:/etc/apache2/sites-enabled# cat /home/sxxu/apache2/sites-enabled/000-default + + ServerAdmin webmaster@localhost + + DocumentRoot /var/www + + Options FollowSymLinks + AllowOverride None + + + Options Indexes FollowSymLinks MultiViews + AllowOverride None + Order allow,deny + allow from all + HeaderName footer.html + + + ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ + + AllowOverride None + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch + Order allow,deny + Allow from all + + + ErrorLog ${APACHE_LOG_DIR}/error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog ${APACHE_LOG_DIR}/access.log combined + + Alias /doc/ "/usr/share/doc/" + + Options Indexes MultiViews FollowSymLinks + AllowOverride None + Order deny,allow + Deny from all + Allow from 127.0.0.0/255.0.0.0 ::1/128 + + + +root@mirrors:/etc/apache2/sites-enabled# + +``` + +添加的/var/www/footer.html配置文件如下: + +``` +root@mirrors:/etc/apache2/sites-enabled# cat /var/www/footer.html + + + + + + + + + +

研发一部资料

+ + +root@mirrors:/etc/apache2/sites-enabled# +``` + +#### 配置二级域名 + +在上述配置完一级域名的基础上,配置二级域名示例。 + +修改apache2服务配置文件/etc/apache2/sites-available/default,添加二级域名的配置。配置如下: + +``` + + ServerAdmin gdzhang@linx-info.com + DocumentRoot /var/www/tslog.rd.in.linx + ServerName tslog.rd.in.linx + HeaderName footer.html + ErrorLog ${APACHE_LOG_DIR}/tslog.rd.in.linx-error_log + CustomLog ${APACHE_LOG_DIR}/tslog.rd.in.linx-acess_log combined + + +``` + +整个配置文件default示例如下: + +``` + +root@mirrors:/etc/apache2/sites-available# cat default + + ServerAdmin webmaster@localhost + + DocumentRoot /var/www + + Options FollowSymLinks + AllowOverride None + + + Options Indexes FollowSymLinks MultiViews + AllowOverride None + Order allow,deny + allow from all + HeaderName footer.html + + + ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ + + AllowOverride None + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch + Order allow,deny + Allow from all + + + ErrorLog ${APACHE_LOG_DIR}/error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog ${APACHE_LOG_DIR}/access.log combined + + Alias /doc/ "/usr/share/doc/" + + Options Indexes MultiViews FollowSymLinks + AllowOverride None + Order deny,allow + Deny from all + Allow from 127.0.0.0/255.0.0.0 ::1/128 + + + + + ServerAdmin gdzhang@linx-info.com + DocumentRoot /var/www/tslog.rd.in.linx + ServerName tslog.rd.in.linx + HeaderName footer.html + ErrorLog ${APACHE_LOG_DIR}/tslog.rd.in.linx-error_log + CustomLog ${APACHE_LOG_DIR}/tslog.rd.in.linx-acess_log combined + + +``` + +在对应的目录/var/www/tslog.rd.in.linx下,添加配置文件footer.html(页面设置)。 + +示例文件如下: + +``` + +root@mirrors:/var/www/tslog.rd.in.linx# cat footer.html + + + + + + + + + +

研发一部信息收集记录

+ftp上传下载使用方法 +:只能上传不能删除,如上传有误需删除请联系管理员 +
+linx6.0系统登录ftp服务器执行上传下载任务的方法:
+(1)点击左面左上角的“位置”列表;
+(2)在下拉菜单中选择“连接到服务器”(此时会出现一个连接到服务器的配置框);
+(3)配置ftp服务器:
+    服务类型“FTP(需登录)”,服务器“tslog.rd.in.linx”,端口“21”,用户名“ts”
+    配置之后,点击“连接”,此时需要输入登录口令“rocky”
+(4)登陆成功,自动打开tslog的文件浏览页面,或者通过桌面主文件夹中的网络类中的tslog目录访问;
+(5)tslog的远程浏览页面中,可以在需要上传的位置直接粘贴文件(在本机复制需上传的信息记录等);
+(6)如需下载,则可直接从tslog复制到本机即可。
+
+
+ + + +``` + +关于footer.html指定的设置页面格式的配置文件github-markdown.css,在这里不做记录,可到172.16.0.234的配置目录中(与footer.html同级)查找。 + +## 配置proftpd服务 + +注意配置/etc/proftpd.conf,创建目录/home/ts/logs + +``` +DefaultRoot ~/logs +... + + + DenyUser ts + + +``` + +