Tagged with: Samba CentOS 7
Install Httpd,php,mariadb,samba-client on Host A, and as Samba client, install Samba on Host B as Samba server. A host Ip192.168.199.157,b host IP 192.168.199.174.
1. Install Httpd,php,php-mysql,mariadb,samba-client on Host a
~]# yum install httpd php php-mysql mariadb-server samba-client
2. Install Samba on Host B and create a directory/data, create a system user CentOS, change the password to CentOS, modify the genus belonging to CentOS for this directory, and add the CentOS user to the file that Samba manages, and the password is also CentOS;
~]# Yum Install Samba
~]# Mkdir/data
~]# Useradd-r CentOS
~]# Chown Centos.centos/data
~]# smbpasswd-a CentOS
3. Edit the Samba profile/etc/samba/smb.conf on Host B and start the service;
~]# vim/etc/samba/smb.conf
[Share_fs]
Comment = mariadb data dir
Path =/data
browseable = yes
Guest OK = No
Write list = CentOS
~]# systemctl Start Smb.service
4. Create the/mydata directory on host A, modify the main genus for MySQL, mount the Samba share directory/data to the local/mydata;
~]# Mkdir/mydata
~]# Chown Mysql.mysql/mydata
~]# mount-t cifs-o Username=centos,password=centos//192.168.199.174/share_fs/mydata
5. Edit the MARIADB configuration file on Host A, modify the data directory, and then turn off SELinux and start the MARIADB service;
~]# vim/etc/my.cnf
Datadir=/mydata
~]# Setenforce 0
~]# systemctl Start Mariadb.service
6. CREATE DATABASE TestDB on Host A, user testuser, password testpasswd, and do authorization:
~]# MySQL
mariadb[(none)]>createdatabase TestDB;
mariadb[(none)]>createuser ' testuser ' @ ' 127.0.0.1 ' identified by ' testpasswd ';
mariadb[(None)]>grant all on testdb.* to ' testuser ' @ ' 127.0.0.1 ';
mariadb[(none)]>flush privileges;
7. Edit the httpd profile on host A, modify the servername to www1.magedu.com, the default home page is index.php, and start the service;
~]# vim/etc/httpd/conf/httpd.conf
DirectoryIndex index.php index.html
ServerName www1.magedu.com:80
~]# systemctl Start Httpd.service
8. Download word on Host A and extract it to the/var/www/html directory;
9. Modify the wp-config-sample.php file named wp-config.php in the/var/www/html/directory on Host A, and edit the file:
~]# mvwp-config-sample.php wp-config.php
~]# Vim wp-config.php
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/84/97/wKiom1eVs1CBPf88AAAs21F05Ig687.png "title=" 2.png " alt= "Wkiom1evs1cbpf88aaas21f05ig687.png"/>
Modify the Hosts file on a Windows host and test
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/84/97/wKiom1eVs3jAY8R1AADRy7AU1Bs379.png "title=" 4.png " alt= "Wkiom1evs3jay8r1aadry7au1bs379.png"/>
Build a lamp platform and install WordPress via the Samba share directory (ii)