Posted by MilanT on June 4, 2010 at 6:50pm
Hello. I am fairly new to Drupal so please excuse my ignorance. I have my drupal all setup at work(developing a site for my company) and am now going to set it up on my home machine (to create my own personal site). Should I get a domain and host and create the site from there or should/can i build the site on my own machine and later upload it to the hosting site's server?
I guess since i am new to drupal, i am not exactly sure what entirely would need to be loaded to the host.
Thanks for your help.
Comments
Set up a host name for your site locally
Hi, Below is what I did.
I assume you have a website package installed on your system like WampServer, XAMPP or DAMP. If not, you can download one from SourceForge.org.
I added a site called mysite to the hosts file. You must be the administrator in windows or root in linux or OS/X to do this. To open notepad as administrator select Start -> All Programs -> Accessories -> Notepad, then using the right mouse key select run as Administrator.
Open the hosts file:
/etc/hosts on linux or OS/X or C:\S
C:\Windows\System32\drivers\etc\hosts on Windows
Add the line to the end of the file:
mysite 127.0.0.1
Exit out of administrator or root user id.
Edit httpd-vhosts.conf file. This is located in the Apache directory. Mine is in C:\web\xampp\apache\conf\extra\httpd-vhosts.conf.
I commented everything in the file and added the following:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "C:\web\xampp\htdocs"
ServerName localhost
ServerAlias localhost
<Directory C:\web\xampp\htdocs>
Options FollowSymLinks
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName mysite
DocumentRoot "C:\mysite"
<Directory C:\mysite>
Options Includes FollowSymLinks
Order allow,deny
AllowOverride All
Allow from all
</Directory>
</VirtualHost>
You can build the site in the C:\mysite directory. This will be the root of your site. You can add as many sites as you wish by adding another line in the hosts file and another stanza in virtual-hosts.conf
Next, open the httpd.conf file in apache/conf. Uncomment the line:
Include "conf/extra/httpd-vhosts.conf"
This overrides the vhosts entries in the httpd.conf file.
You're done.
Be sure you still have access to all the configuration tools (myphpadmin). If you have a problem, check that the entries in the httpd.conf file jive with the entries in the localhost stanza in the httpd-vhosts.conf file.
you can just add the comment back to the httpd-vhosts.conf file in httpd.conf to disable the hddpd-vhosts.conf file.
Put your site files in C:\mysite, and just type in mysite in the url of your browser.
Good luck
Ok great! Thank you! So when
Ok great! Thank you! So when i upload my files to the hosting sites server, do i just dump the whole drupal folder in there? Is there more than just that necessary?
Upload to Host Site
I do my development locally, on my own PC and then when I am ready I upload it to the hosting site. There's a very good video on how to do it in Learn By the Drop: http://learnbythedrop.com/gettingstarted
There are 15 videos in this series, scroll down until you see Moving a Local Site to the Web. It goes through it. I used it when I moved my Local Site from my PC to my Mac. You need to export your database, create on on your hosting site and import the database there. You need to move all your files (be sure to get hidden files like .htaccess). Then you need to configure the .../sites/default/files/settings.php file to with the user ID and password of your new database. Update the line: $db_url = 'mysql://username:password@localhost/databasename'; (and $db_prefix if you have a prefix on your database tables).
Once I upload it to my hosting site, I don't plan to bring it back down to my PC.
Regards, Jack
=-=
you can do either. build directly online or offline. I prefer offline and deploying when a site is done in most cases.
hi topserb96, Although
hi topserb96,
Although building offline is a good option, if you are new to the kind of technology related to a CMS website I would recommend to do it online. "Simple" html website can be just uploaded to a server and they will work. But with a CMS you are working with a combination of a database, php, html and CSS. Like I said, if you are new to this, just start online. That way you don't have to import your database, do complex setups locally and, most important, you can see directly how your website behaves under the influence of different contributed modules.
If your hosting account allows you to, you can have two versions of your website. A sort of sanbox where you can try out stuff and occasionaly demolish something, and one production version which you can treat with more care. With the backup and migrate module (www.drupal.org/project/backup_migrate and www.drupal.org/project/backup_migrate_files) you can easily migrate your database and code between the two.
And last but not least.... welcome to Drupal!
----
"People make mistakes. To really mess something up you need a computer."
Thank you for this Alf!
Thank you for this Alf!