1.acl權(quán)限設(shè)置
2.修改apache進(jìn)程執(zhí)行者
3.修改samba的訪問用戶
4.用samba對apache網(wǎng)站根目錄進(jìn)行共享
5.在windows中用"映射網(wǎng)絡(luò)驅(qū)動器"把linux下網(wǎng)站根目錄映射到本地的磁盤中
6.確保php代碼在linux下創(chuàng)建的目錄或文件的權(quán)限適當(dāng)
LAMP網(wǎng)站環(huán)境:
系統(tǒng):Linux
Web服務(wù)器:apache
動態(tài)程序:php
數(shù)據(jù)庫:mysql
[if !supportLineBreakNewLine]
[endif]
acl權(quán)限設(shè)置:
1.useradd apache
2.setfacl -m u:apache:rwx -R /usr/local/apache2/htdocs
3.setfacl -m d:u:apache:rwx -R /usr/local/apache2/htdocs
修改apache進(jìn)程執(zhí)行者:
1.vi /usr/local/apache2/etc/httpd.conf
User apache
Group apache
2./usr/local/apache2/bin/apachectl restart
3.ps –ef |grep httpd查看httpd進(jìn)程的執(zhí)行者
修改samba的訪問用戶:
1.安裝samba服務(wù)器所需的軟件
yum –y install samba* --skip-broken
2.修改samba配置文件,并把a(bǔ)pache網(wǎng)站根目錄共享
Vi /etc/samba/smb.conf
[web]
path=/usr/local/apache2/htdocs/
browsable=yes
writeable=yes
3.創(chuàng)建samba用戶apache
smbpasswd -a apache
4.啟動samba服務(wù)
Service smb restart
在windows中用"映射網(wǎng)絡(luò)驅(qū)動器"掛載linux下網(wǎng)站根目錄
1.我的電腦->工具->映射網(wǎng)絡(luò)驅(qū)動器->設(shè)置共享文件夾
2.映射linux共享文件夾到windows下的Z盤:
\\192.168.100.1\web到Z盤
確保php代碼在linux下創(chuàng)建的目錄或文件的權(quán)限適當(dāng)
1.目錄的權(quán)限是否適當(dāng):
$dir=”test”;
Mkdir($dir,0755);
2.文件的權(quán)限是否適當(dāng):
$file=”test.php”;
$str=”
web page test
”;File_put_contents($file,$str);
Chmod(“$file”,644);
ok缘回,linux網(wǎng)站服務(wù)器在windows下開發(fā)已經(jīng)完成準(zhǔn)備好了饥侵,你可以用你在windows下喜歡的所有的編輯網(wǎng)站編輯器了扛禽,接著就看你的了,呵呵.