Local personal web site on line the whole process, for your reference (PHP, LAMP environment to build simple)

 

One: what you need to be prepared

  1. Local access to the site, it is best to turn over a host file and the apache httpd-vhosts.conf, configure the kind of local domain names (to reduce the problems spread line appears, the file path is not right about her)

   2. a cloud server or cloud hosting, personally recommend the cloud server feature comparison can be a buy from Ali cloud Tencent cloud Baidu cloud what is selected, look at the situation to buy small personal website, then the minimum configuration of the line (about 100+ year)

   3. a domain name, visit www think that such domain names through, then it should not then also through the ip address of the server access, such as 49.234.127.79 way is to buy the domain name obtained from a variety of cloud selected Article 2 , probably dozens of pieces a year

 

 

1. a local site, such as

 

 

 

The local domain name is configured through the host c disk file and the apache httpd-vhosts.conf file (I use the integrated environment is wamp), cases

 

 

 

 

2. Server (here take Tencent cloud servers to demonstrate)

 

 

 

 

 Ineligible can choose other ways to buy time to make the choice to buy the system, to demonstrate here take centos6

Xshell connect to the server I use ,, other software to connect servers also similar

 

 

 

 

 Just fill in the name, and then fill in the host public network ip and port number after (port 22 by default, can be changed later), you will be prompted to enter a user name and password

These information will get you to buy a server

Such information is displayed after a successful connection

 

 

 The following is a LAMP environment to build the beginning I choose the command-line installation, and then found version is too low, then I got a pagoda linux panel, a key installation environment

The following command download linux pagoda panel

yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh

 

After download and install the pagoda will see a login address and account password

 

 

 

 

 

 General account is your public ip + 8888 port, we enter this address in your browser and enter the account password to login

 

 

 

 

 

 

 

 Is such an interface, return to the familiar windows interface, the rest is a fool-operation

 

 

 

First, we point to the left of the menu bar to the management server software installation LAMP environment, do not choose too low version

 

 

 

After installing the Web site point to the left of the menu bar after setting up and running, create a new Web site points

 

 

 There are domain name registration and domain name resolution can fill, no fill on the first host of the public network ip, root can own a name, database user passwords (behind the convenient connection),

After clicking submit we generated a website, enter the public ip access in a browser

 

 

 

Here we landed Xftp or FTP filezilla and other management software, no download, (purpose: to put our local website to go inside)

Need to install the package of the class can contact me QQ: 172579149

 

Xftp connection with the previous connection Xshell almost, just fill in the name, and then fill in ip, protocol selected SFTP, port number did not turn on the default user name and password username password server

 

 

 

After logging in to the right to see the file on your server, our website is a directory with www / wwwroot,

 

 

 And went into the project file we created the folder inside, index.html is our site after the completion of the new browser to open the site to see the creation of a successful interface

Delete it, and then our project (website) Drag here

 

 

 

We can pagoda where the root directory of the site given to our web portal file there, the general framework is public following index is an entry document, given to the public on the line below, this is my little work, that is, outside the entrance file index.php

 

The next step is to connect our database, guided into the database

 

 

 Database can be seen here on the left we create a database user name and password for each site time, remember to choose where everyone can be connected in authority, (subsequent to the lead after the database and do not need to change the permissions you can adjust the cost of access, so a little safer)

 

 

 

Remote connection to the database I chose navicat, may also be connected to other software mysql   

Step by step input ip, username and password click on the test database, suggesting a successful connection can be identified

 

 

 

Once connected open our database, sql file can be run right into the database, and a local pilot sql file, and then import

 

 

Or click here to have a data transfer tool, directly to the table what data synchronization over

 

 

 

 

 

 选好两个要传输的数据库和要传的数据表,点击开始就可以了,左边传给右边

 

 

数据库也导入了之后我们再去浏览器打开ip地址,不出意外网站就出来了,显示403说明路径不对,

可以调一下宝塔那边的网站设置的网站目录,网页样式不对就是路径问题,网站报错就是代码问题了,看着改

 

 

 

到此为止别人就能从网址访问到我们的网站啦!!

 

域名与网站关联:

1.注册一个域名  2.走域名备案的流程,会有提示的 3.备案成功后...

 

从哪个平台注册的域名就去哪个平台找到域名管理

 

 

 

如果服务器和域名是同一个平台的就直接点解析,不同平台的比如我腾讯云的服务器百度云的域名

就点一下域名信息,修改一下DNS

 

 

 

 至于改成啥,你去相应平台的域名管理看看或百度搜索就好了

 

 

 

 

 

 然后返回去点解析域名->添加解析

 

 

 

这里的问号都有说明, ipv4就是我们填了好多次的服务器公网ip

 

 

 

填完后我们去宝塔那里修改一下网站的信息,点设置,然后添加域名,把刚才解析的域名填上去,再去浏览器用域名代替ip来访问,看看是不是大工告成啦!!,

有疑问欢迎留言评论,本人也不是大神,刚刚学会的分享一下给大家,欢迎大家一起交流学习

 

 

 

 

 

 

 .

 

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/youantianqin/p/11879651.html