`
一流涌进
  • 浏览: 5370 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

基于上海宝付的php网站架设

    博客分类:
  • php
阅读更多
1. 添加用户

输入命令:adduser autodownload

输入密码:autodownload

然后一直敲回车到如下画面,输入y敲回车完成添加用户

基于Debian6.0.7的php网站架设
2. 安装vim编辑器:

(注意:在安装下面所有软件时,光盘必须挂载,且在挂载目录下,及本例的/media/cdrom目录下)

输入命令:apt-get install vim,安装过程会询问是否继续,输入y敲回车继续安装

基于Debian6.0.7的php网站架设
基于Debian6.0.7的php网站架设
3. 编辑ssh_config,输入命令:vim /etc/ssh_config敲回车打开ssh_config文件,按向下键到文本尾段,然后按“i”键进入编辑模式,在文本中添加

UsePAM yes

UseDNS no

基于Debian6.0.7的php网站架设
添加完后按“esc”键退出编辑模式,再按“shift+;”进入底行模式,输入“wq”保存退出。若退出不保存的话则输入“q!”

4. 安装解压缩软件

依次输入下面四条命令并敲回车,会自动安装这些软件

apt-get install tar

apt-get install bzip2

apt-get install wget

apt-get install unzip

基于Debian6.0.7的php网站架设
基于Debian6.0.7的php网站架设
基于Debian6.0.7的php网站架设
基于Debian6.0.7的php网站架设
5. 安装proftpd

输入命令apt-get install proftpd进行安装,当出现询问是否继续的画面时输入y敲回车继续

基于Debian6.0.7的php网站架设
基于Debian6.0.7的php网站架设
然后系统弹出如下画面,选择standalone敲回车继续,系统会自动完成安装

基于Debian6.0.7的php网站架设
6. 安装apache2,输入命令apt-get install apache2后敲回车,系统会自动完成安装

基于Debian6.0.7的php网站架设
7. 安装php5,输入命令apt-get install php5后敲回车,系统会自动完成安装

基于Debian6.0.7的php网站架设
8. 安装mysql-server,输入命令apt-get install mysql-server后敲回车,当出现询问是否继续的窗口时输入y继续

基于Debian6.0.7的php网站架设
基于Debian6.0.7的php网站架设
如下,输入密码mtd2013,不能随意更改为其它密码,确认OK后敲回车继续

基于Debian6.0.7的php网站架设
基于Debian6.0.7的php网站架设
9. 安装mysql-client,输入命令apt-get install mysql-client后敲回车,系统会自动完成安装

基于Debian6.0.7的php网站架设
10.安装php5-mysql,输入命令apt-get install php5-mysql敲回车,系统会自动完成安装

基于Debian6.0.7的php网站架设
11.安装libapache2-mod-php5,输入命令apt-get install libapache2-mod-php5敲回车,系统会自动完成安装

基于Debian6.0.7的php网站架设
12.安装php5-gd,输入命令apt-get install php5-gd敲回车,当出现询问窗口时输入y继续

基于Debian6.0.7的php网站架设
基于Debian6.0.7的php网站架设
13.安装phpmyadmin,输入命令apt-get install phpmyadmin敲回车,当出现询问窗口时输入y继续

基于Debian6.0.7的php网站架设
基于Debian6.0.7的php网站架设
当出现如下窗口时选择apache2后敲回车

基于Debian6.0.7的php网站架设
选择Yes敲回车

基于Debian6.0.7的php网站架设
依次在下面三个界面输入密码mtd2013,不可随意修改密码

基于Debian6.0.7的php网站架设
基于Debian6.0.7的php网站架设
基于Debian6.0.7的php网站架设
至此,所有必需的软件安装完成。



配置方案:

该配置方案为本人为厂内建立Server时所用,仅供参考!

A. 将文件proftpd.conf拷贝到/etc/proftpd目录下并覆盖原来的文件

proftpd.conf文档内容如下,已将注释内容删除:

DelayEngine off
IdentLookups off
UseReverseDNS off
Include /etc/proftpd/modules.conf
UseIPv6 on
IdentLookups off
UseReverseDNS                   off
RootLogin                       on
UseFtpUsers                     on
ServerName "Debian"
ServerType standalone
DeferWelcome off
MultilineRFC2228 on
DefaultServer on
ShowSymlinks on
TimeoutNoTransfer 600
TimeoutStalled 600
TimeoutIdle 1200
DisplayLogin                    welcome.msg
DisplayChdir               .message true
ListOptions                "-l"
DenyFilter \*.*/
DefaultRoot                 /home/proftpd
Port 21
<IfModule mod_dynmasq.c>
</IfModule>
MaxInstances                    100
User proftpd
Group nogroup
Umask 021
TransferLog /var/log/proftpd/xferlog
SystemLog   /var/log/proftpd/proftpd.log
<IfModule mod_quotatab.c>
QuotaEngine off
</IfModule>
<IfModule mod_ratio.c>
Ratios off
</IfModule>
<IfModule mod_delay.c>
DelayEngine on
</IfModule>
<IfModule mod_ctrls.c>
ControlsEngine        off
ControlsMaxClients    2
ControlsLog           /var/log/proftpd/controls.log
ControlsInterval      5
ControlsSocket        /var/run/proftpd/proftpd.sock
</IfModule>
<IfModule mod_ctrls_admin.c>
AdminControlsEngine off
</IfModule>
<Directory /home/proftpd/file>
<Limit DELE>
AllowUser  autodownload 
</Limit>
</Directory>
<Directory /home/proftpd/BIOS>
<Limit DELE>
AllowUser autodownload 
</Limit>
</Directory>
#cancel the DELE /RMD/RNTO permission, by TE at 2014/03/03
<Directory /home/proftpd>
<Limit DELE RMD RNTO>
Denyuser autodownload
Allowuser teupload
</Limit>
</Directory>
<Directory /home/proftpd/Program/>
<Limit STOR DELE WRITE>
Allowuser teupload
Denyuser autodownload
</Limit>
</Directory>
<Directory /home/proftpd/INIScp/>
<Limit STOR DELE WRITE>
Allowuser teupload
Denyuser  autodownload
</Limit>
</Directory>
<Directory /home/proftpd/BIOSScp/>
<Limit STOR DELE WRITE>
Allowuser teupload
Denyuser  autodownload
</Limit>
</Directory>
<Directory /home/proftpd/Image/>
<Limit STOR DELE WRITE>
Allowuser teupload
Denyuser  autodownload
</Limit>
</Directory>
B. 将swdb.conf文件拖到/etc/apache2/sites/available目录下

swdb.conf文档内容如下:

# phpMyAdmin default Apache configuration
Alias /pe/ini /var/www/pe/ini
<Directory /var/www/pe/ini>
Options FollowSymLinks
DirectoryIndex index.php
</Directory>
#Alias /phpmyadmin /usr/share/phpmyadmin
Alias /swdb /home/autodownload/swdb
<Directory /home/autodownload/swdb>
Options FollowSymLinks
DirectoryIndex index.php
<IfModule mod_php4.c>
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
</IfModule>
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
</IfModule>
</Directory>
# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
    <IfModule mod_authn_file.c>
    AuthType Basic
    AuthName "phpMyAdmin Setup"
    AuthUserFile /etc/phpmyadmin/htpasswd.setup
    </IfModule>
    Require valid-user
</Directory>
# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libraries>
    Order Deny,Allow
    Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
    Order Deny,Allow
    Deny from All
</Directory>
C. 将文件php.ini拖到/etc/php5/apache2目录下覆盖原来文件

php.ini文件内容如下,删除了很多内容,有其它需求的请拿原版文件进行修改:

[PHP]
engine = On
short_open_tag = On
asp_tags = Off
precision = 14
y2k_compliance = On
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 100
allow_call_time_pass_reference = Off
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions =
disable_classes =
expose_php = On
max_execution_time =300
max_input_time =600
memory_limit =200M
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = On
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = Off
variables_order = "GPCS"
request_order = "GP"
register_globals = Off
register_long_arrays = Off
register_argc_argv = Off
auto_globals_jit = On
post_max_size =200M
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize =200M
max_file_uploads = 200
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout =300
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Syslog]
define_syslog_variables  = Off
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = On
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout =-1
mysql.trace_mode = Off
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[PostgresSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[Session]
session.save_handler = files
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = Off
session.bug_compat_warn = Off
session.referer_check =
session.entropy_length = 0
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[ldap]
ldap.max_links = -1
D. 将文件my.cnf文件拖到/etc/mysql目录下

my.cnf文件内容如下:

[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
skip-external-locking
skip-name-resolve
wait_timeout=28828800
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
key_buffer = 16M
max_allowed_packet = 500M
thread_stack = 192K
thread_cache_size       = 8
myisam-recover         = BACKUP
query_cache_limit = 1M
query_cache_size        = 16M
expire_logs_days = 10
max_binlog_size         = 100M
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
[isamchk]
key_buffer = 16M
!includedir /etc/mysql/conf.d/
E. 然后转到/home/autodownload目录下,右击新建文件夹swdb,将php开发的网页相关文件全部拷贝到swdb文件夹下。

F. 添加链接(我也不知道这步是干什么,我就照着做),输入命令cd /etc/apache2/sites-enabled跳转目录,

然后再输入命令

ln –s ../sites-available/swdb.conf 002-swdb.conf敲回车在sites-enabled目录下添加链接

输入ls -al,如看到如下内容则说明链接成功

基于Debian6.0.7的php网站架设
G. 找一台电脑,打开网页,输入ServerIP地址/swdb,若能打开网页则说明配置完成
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics