首先是安装Apache,输入
安装后的Apache就已经直接可以运行了,可以输入http://127.0.0.1查看效果。 之后是根据自己需要配置了 Apache的配置文件在/etc/apache2/apache2.conf中 Apache的默认站点配置文件在/etc/apache2/sites-enabled/000-default中 Apache的默认站点目录在/var/www/中 要为站点建立子目录,可以在/var/www/下建立相应的目录,也可以在/etc/apache2/sites-enabled创建专用的配置文件。
接下来是设置虚拟站点。我是直接在/etc/apache2/sites-enabled下创建专用的配置文件的。
在其中任意创建一个文件,然后写入别名站点信息:
Alias的作用是为地址创建别名。假设主机地址是localhost,那么http://localhost/test/就会被Apache映射到/home/www目录下
接着就是写入权限设置了,使用<Directory />段来配置:
相关选项的含义如下:
Options: 提供一系列权限选项,有Indexes(允许列出目录)、MultiViews(多种内容显示方法)、FollowSymLinks(使用符号链接)。其 中Indexes是非常危险的,如果不是作为调试或者个人使用,最好去除。FollowSymLinks应该是指能把Linux的符号链接当作一个正常的 文件吧,没仔细研究。
AllowOverride:是否启用.htaccess配置文件。
Order:控制默认的访问状态与Allow和Deny指令生效的顺序。
Allow、Deny:设置授权和禁止列表,格式为 Allow(Deny) from
all|host|env=env-variable [host|env=env-variable] ...。一般主要用All和host,其中host可以有以下几种用法:
示例:
Allow from apache.org
Allow from .net example.edu
主机名与给定字符串匹配或者以给定字符串结尾的主机允许访问。只有完整的名字组成部分才被匹配,因此上述例子将匹配foo.apache.org
但不能匹配fooapache.org
。这样的配置将导致Apache不管HostnameLookups
指令是如何设置的,对一个对客户IP地址都要执行两次DNS查询:一次正查询保证IP没有伪造,一次反查询保证主机名没有伪造。只有两次查询的结果都吻合,并且主机名能够被匹配,访问才被允许。
示例:
Allow from 10.1.2.3
Allow from 192.168.1.104 192.168.1.205
;允许拥有这些IP地址的主机进行访问。
示例:
Allow from 10.1
Allow from 10 172.20 192.168.2
IP地址的开始1到3个字节,用于子网限制。
示例:
Allow from 10.1.0.0/255.255.0.0
一个网络"a.b.c.d"和一个掩码"w.x.y.z",用于更精确的子网限制。
示例:
Allow from 10.1.0.0/16
同前一种情况相似,除了掩码由nnn个高位字节构成。
注意以上例子中的后三个匹配完全相同的一组主机。
IPv6地址和IPv6子网可以像下面这样指定:
Allow from 2001:db8::a00:20ff:fea7:ccea
Allow from 2001:db8::a00:20ff:fea7:ccea/10
安装PHP很简单,直接用apt-get就行:
安装后自动与Apache集成,不用进行额外设置,很方便。
首先安装MySQL:
安装过程中会要求设置root账号。 然后是安装PHP对MySQL的支持:
安装:
安完就能用了
要重启ssh,可以使用这个命令
要启动和停止ssh,只要把restart换成start和stop就行了
安装vsftpd
安装:
为了使用虚拟帐户,还要安装Berkeley Database Utilities:
编辑配置文件:
内容如下:
建立相关配置目录:
创建编辑虚拟用户文件
内容为一行用户名一行密码,如
就创建了两个虚拟用户,一个是upload,密码为up;另一个是anim,密码为manga
生成账号文件对应的db文件,要用上刚才安装的Berkeley Database Utilities:
编辑vsftpd的pam服务,用于账号验证:
注意服务的文件名是由vsftpd.conf的pam_service_name决定的
把服务替换成如下内容
这个文件原来可能有其他内容,必须去掉,不然会产生认证冲突无法登录
要注意的是,这样做之后就无法用本地账号登录了,如果在配置里没有开启virtual_use_local_privs,虚拟账号的权限等同于匿名用户
为每个账号作特别配置:
账号配置文件要放在vsftpd.conf的user_config_dir段所指定的目录下,在这里是/etc/vsftpd/vsftpd_user_dir
以upload账号为例,编辑文件
格式与vsftpd的配置文件相同,不过只能设置与用户相关的选项。在这里设置上传权限和根目录:
注意anon_upload_enable,如果没有配置virtual_use_local_privs=YES,则虚拟账号相当于匿名用户,所以只设write_enable是不够的
研究中……
Sep 18, 2019 04:06:42 PM
Yet, if you are researching for “regular maintenance, ” you may need maid maintenance services which unfortunately charge usually in line with the number for maids, and also time demanded. Maid maintenance companies could possibly price your services for 25 that will 35 AED hourly.
Nov 15, 2019 01:06:41 AM
Look at the skills you require to home based. Just just as in any career, when conversing with a prospective employer highlight those expertise outlined inside the job advertisement. Then give attention to what makes a simple yet effective employee which works from your home.
Mar 24, 2020 08:28:13 PM
Athletics Betting Champ c3300k, John Morrison, then took to create his existing, combining the two his love for athletics and figures, in the globe of specialized gambling. John can be well preferred, from people across the world, for the gambling suggestions.
Mar 24, 2020 08:28:40 PM
The majority of people define extravagance majorly with regard to price but there may be so much more to luxury than simply how much money did you expend. It can be quite hard to help define extravagance homes within the exact technique because it is something derived from several variables.
Mar 24, 2020 08:29:04 PM
For anyone who is buying your dream house that was previously inspected then you need to have your unique inspection done for being protected seeing that fully as is possible. If anyone says to you it's fine make use of the preceding home check up report there're wrong. Your are not covered well by any means. When Habitation Research does your dream house inspection your customer has the ability to get a 18 thirty days warranty with the fee connected with 12 many weeks.
Mar 24, 2020 08:29:31 PM
So you intend to be roaring success real real estate investor? Very well, you really need your goal setting tools in brand. In order to give the greatest probability of achieving ones goals you ought to be setting CLEVER goals. At this point, not this Webster meaning of clever, but quite SMART for acronym intended for Specific, Measurable, Feasible, Realistic, in addition to Timely.
Mar 24, 2020 08:29:53 PM
Real estate investment is this legal period encompassing area with something placed on the area like houses, particularly property or home. These usually are immobile or maybe fixed houses. It would be the common jargon utilised in several jurisdictions like Australia, The us, United Kingdom and north america.
Mar 24, 2020 08:30:25 PM
One cause of capital of which businesses typically overlook is usually Vendor Credit ratings. Without a robust banking marriage and history of credit dealing having any traditional bank as your own business looking for just a traditional loan or maybe a working business loan can be quite hard and disheartening.
Apr 29, 2020 06:25:34 PM
After you hire some sort of servant maid to decontaminate you house or office, you usually are permitting her to reach to your very own belongings. And so before selecting a cleaning service, you really should ask a number of questions to discover more regarding her track record information in addition to personal experience. First matter is of which, you really should inquire your buddies, relatives or maybe acquaintances with regards to personal experience while using the servant maids.
Apr 29, 2020 06:25:46 PM
If you would like give the house a certain style of atmosphere, then inner surface paints are important. The paints you choose are able to offer either temperature or coolness towards rooms of your dwelling and if you need to paint by yourself or seek the services of house painters; keep as the primary goal we now have many ideas that you consider. These thoughts include buying things such as right colour, colors, colours, schemes, coloration methods, as well as other related facets.
Jun 07, 2021 03:10:47 PM
Try to avoid using cellular phones, tablets, televisions for the purpose of televisions whereas cleaning home. Because this will likely slow downwards the pace of this work. At the same time, you will end up having reduced energy in order to keep the vacuuming process. Which means, put separate these distractions to raise the general process.