samba共享
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了samba共享相关的知识,希望对你有一定的参考价值。
项目实践+博客作业:
(1) 使用samba共享/data/application/web,在目录中提供wordpress;
(2) 使用samba客户端挂载samba server共享的目录至/var/www/html;
(3) 客户端(lamp),部署wordpress,并让其正常访问;要确保能正常发文章,上传图片;
(4) 客户端2(lamp),挂载samba server共享的目录至/var/www/html;验正其wordpress是否可被访问;要确保能正常发文章,上传图片;
答:
一、# yum install -y samba
# iptables -F
# setenforce 0
# systemctl start smb.service
# vi /etc/samba/smb.conf
[myshare]
comment = my share
/data/application/web
browseable = yes
writable = yes
public = no
write list = little
create mask = 0777
directory mask = 0777
# mkdir -pv /data/application/web
# systemctl reload smb.service
# pdbedit -a -u little
# chown -R little:little /data/application/web
# cp wordpress/wp-config-sample.php wordpress/wp-config.php
# vim wordpress/wp-config.php
# chmod o+w wordpress/wp-content
二、# yum install -y mariadb-server
# systemctl start mariadb.service
# mkdir -pv /var/www/html
# systemctl reload php-fpm.service
# mount -t cifs -o username=little,password=123123 //172.16.72.1/myshare /var/www/html
三、# yum install -y httpd php-fpm php-mysql
# vi /etc/httpd/conf.d/vhosts-www.conf
<VirtualHost 172.16.72.1:80>
DocumentRoot "/var/www/html"
ServerName www.little.com
directoryIndex index.php
ProxyRequests on
<Directory "/myweb/vhosts/www"
Options None
AllowOverride None
Require all granted
</Directory>
<VirtualHost>
# groupadd -g 1001 little
# useradd -u 1001 -g little little
# systemctl reload php-fpm.service httpd.service
# mkdir -pv /var/www/html
# mount -t cifs -o username=little,password=123123 //172.16.72.1/myshare /var/www/html
以上是关于samba共享的主要内容,如果未能解决你的问题,请参考以下文章