Creating a website on Linux?

Altiris

Honorable
Jun 17, 2012
409
0
10,780
Anyone know of any good tutorials for creating websites on Linux (preferably CentOS 6.4)? I understand the Apache program is mostly used but how do you actually get a website running off of that, with headings and images similar to maybe how Tom'sHardware has their heading and stuff.

Does everything need to be coded in HTML or can you use a designing program such as Microsoft Expression Web which comes with templates and then somehow export that so it works with Apache on Linux?

I dont really know how networking/running a website works (I know you need or its best to have something like MySQL) which is why I am asking. Thanks!
 
Apache is a httpd, or web server, similar to nginx, lightppd, cherokee, etc.. All it does is handle incoming requests. You can also chain httpd for different requests as different httpd are more specialized and more efficient in certain requests.

Yes; all web pages must be coded in HTML. You are free to use a web programming language like PHP, Perl, Python, etc. to interact with a database like MySQL, but you must display the data via HTML. JavaScript is a web-client programming language that is often used for dramatic effect. As you can see to your right, there is a Latest experts section. The arrows are hooked to a JavaScript event that causes the content to change.

As for running a site publicly on the web, you first need an IP address. From there, you'll want to buy a domain name and set up both a DNS and rDNS records.

Obviously, I'm just skimming the topic here.
 
Most websites similar to this use an "out of the box" installation of software like Wordpress. The differences are going to be the templates/themes, and your coding skills (they use PhP) to modify the look/feel of the site. If you have a team of developers, you can write your own code, but given the costs associated with it, Wordpress and alternative CMS installations are free, where developing it yourself could take years.

Google Wordpress and Joomla (use "alternatives" with both to find other packages). There is a lot out there....most of it is fairly simple to install and use.

Wordpress only requires MySQL and Apache Server be installed, and setup takes just a few minutes.
 

Altiris

Honorable
Jun 17, 2012
409
0
10,780
Thanks for the info, I already bought a domain from my ISP and made a DNS server with it. If that is all you have to do then just setting up Apache is probably on the list of the final things to do.

I really would need some good tutorials, I dont understand how some people are able to set all of this up without any aid.
 
I strongly advise against using WordPress. While WordPress is an excellent platform, it is also a hack trap. Unless you update your WordPress regularly with security updates, you are likely to get hacked. So you need to always be alert. When you do get hacked, it's a gateway for a hacker to directly add files to your server. This will cause your site to be flagged by many antivirus applications. Your site may also be blocked off by Google, Yahoo!, etc. for being flagged as a malicious site.

Obviously, code that you write yourself will take longer, but you can secure it better that way.

Most people don't set it up. They hire web developers to set it up, or if they know people who can, they ask them.
 
I'd go with hosting like hostgator or something for a few bucks a month for a few reasons. They handle all the server management, updates, backups, etc. If your site gets hacked, they can restore a backup in a few minutes, patch the hole they got in on, it doesn't suck up your house bandwidth and doesn't expose potentially your whole network to the outside world. If your linux box is connected to your router, there is a way in to everything. They also run huge massive firewalls, etc to stop ways in.

Setting all these up in a task in itself, and then patching and updates and closing holes, you really need to know what you're doing. Apache, PHP, MySQL, Linux all have patches all the time that need to be monitored and updated in order to make sure there is no holes in them. There is a million ways in to be hacked and simple things like running PHP with this config, means Apache needs this config set or else, there is a way in. You update your PHP to a new version, example 4-5, all of a sudden your site doesn't work as PHP changed a bunch of stuff that doesn't work and is depreciated in the newer version, you don't know how to fix it.

I know everyone wants to run their own server but the $3.96 hostgator or other places charge is less than the power your PC will consume being on 24/7 a month and not expose your network, etc. Considering you are just finding out what Apache is and MySQL, and PHP, you'll more than likely leave your PC and entire network open to anyone with even the most basic hacking skills.

I advise people from wanting to run their own server unless they've been using Linux and Apache since the 90's and know it inside and out, otherwise, it's not worth it cost wise or the 54353453 hours you'll spend just to get it up and running and routed and everything.

My 2 cents Canadian.
 

randomizer

Champion
Moderator
Don't even think of trying to run your own server. You don't even have experience building a website, let alone setting up and configuring a web server. It will just cause you unnecessary grief. Even a VPS (which will usually require some configuration unless you buy a managed hosting service) is likely overkill unless you're planning on running a medium to high traffic website. Shared hosting will be fine for low traffic and it's dirt cheap.

As for whether to use WordPress or not, I personally think it's not a bad platform for simple sites. You just need to be careful with your plugins, because they are the primary attack vector for malicious users provided that you keep the core platform up to date. I would not use WordPress for a complex website, but that's because it's too inflexible, not because it's too insecure.

I highly recommend getting a web developer involved regardless of what route you choose simply because they (should) have the experience to get you set up and running and save you from going grey too quickly.



I can guarantee you that this site is not running any off the shelf software :)
 
@randomizer: I guess that was a good assumption. I was thinking server admin != web developer. Someone can know how to manage a server and know nothing about web development.

I do agree that OP should get a web developer involved. If not for coding, at least for tips, best practices, basic structures, etc.
 
I think it really depends upon what you want to do, and the price you way to pay to get it done. Web hosting ($4-$10 per month) will typically cost you less than getting a dedicated IP address assigned to your home ($10-100 per month). Depending upon who you choose to host your website, will determine the amount of control you have and maintenance you will have to do.

These costs not only reflect monthly reoccurring charges, but also will be reflected in the cost of the equipment. You have hardware and software costs.

Also, you can choose a month-to-month plan with a hosting company, and try things out. You can usually do anything from WordPress, Joomla or custom code (PhP, HTML, etc) . There are many things to try out.

When sites become big like Tom's Hardware has become, usually you look at custom code at that point vs. an out of the box package.
 

randomizer

Champion
Moderator


And vice versa. However a good web developer should at least know something about shared hosting. The likelihood that you could have gone through your career and not had any exposure at least to that is pretty slim. VPS and self hosting might require one to be picky about who they get help from.