The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 18, 2013, 05:10:09 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: getting rid of cpanel ??  (Read 913 times)
mightycitizen
Rookie
**
Offline Offline

Posts: 27


View Profile
« on: January 08, 2012, 07:25:30 PM »

cpanel is resource hogging especially while log processing cpanellogd. it eats ram,cpu as much as it can causing issues for sites. currently i have stopped log processing and for my new servers i want to quit commercial/free control panels.

i want to use  basically add domains and give ip for domain. how easily it can be done via ssh so that i load data and it does wotever i needed ? wot its called bash or shell scripting ? how fast a linux guy can do the script ? any idea .. much appreciated.

 Need Help
Logged

No links in signatures please
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10009



View Profile
« Reply #1 on: January 10, 2012, 11:21:25 AM »

When you say, "add domains" what exactly are you adding? Are you just doing spam sites? If you have a VPS then adding sites to Apache is pretty durn easy. If you need dns, mail etc then it gets more tricky.

SSH is all I use, but I'm no rookie. You shouldn't need any scripting, and in fact, if you don't know what you're doing and get a script it could do things incorrectly and really fubar you.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
mightycitizen
Rookie
**
Offline Offline

Posts: 27


View Profile
« Reply #2 on: January 10, 2012, 01:54:25 PM »

hi perk ..

its just all spam sites with awstats/ftp..nothing more..if its easy ill start working on it..
Logged

No links in signatures please
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10009



View Profile
« Reply #3 on: January 10, 2012, 02:08:47 PM »

Are you reasonably comfortable with SSH and the shell Mighty? Please post questions here and I'll be happy to assist.

Are you having someone else host dns? That would be the optimal solution, so that you set DNS to point at your box and then you're good to go. That's how my rigs work - whomever I purchase the domain from handles DNS pointing to my servers. Then it's a pretty simple process to add sites. Really simple in fact. Here's a sketch (ask questions about which of these are confusing):

Set up httpd.conf to listen for named virtual hosts on your IP.
Set up httpd.conf to include anything in a directory where you'll keep individual files for each website. On my server, everything is /usr/local/apache2/conf/sitefiles.
I tell httpd.conf to include everything with a .inc suffix. So I can shut sites down by simply renaming them to (same site name).site or whatever and they won't get included in the next restart of Apache.
Create yourself 3 little scripts to start, stop and cycle apache. These will come in great handy. Personally I use apstart, apstop and apcycle. The apcycle script is simply:
/usr/local/apache2/bin/apachectl -k graceful

which reloads Apache gracefully. I put these scripts in /usr/local/sbin.

Then you'll need virtual host files for your sites. An example might look like this:
<VirtualHost 216.19.223.41:80>
        ServerName       www.mydomain.com
   ServerAlias      wickedsignals.com
        DocumentRoot     /www/sites/mydomain
</VirtualHost>


A more advanced one (including rewrites and SSL) might look like this:
<VirtualHost 216.19.223.41:443>
        ServerName              controlcenter.mydomain.com
        DocumentRoot            /www/sites/mydomain/cc

        SSLEngine               on
        SSLCertificateFile      /usr/local/apache2/conf/ssl.crt/www.mydomain.org.crt
        SSLCertificateKeyFile   /usr/local/apache2/conf/ssl.key/www.mydomain.org.key

        Alias /javascript       /www/sites/mydomain/cc/javascript
        Alias /posters       /www/sites/mydomain/storage/posters
        Alias /trailers       /www/sites/mydomain/storage/trailers

        RewriteEngine           on

        # If it's a resource hit (graphics etc) then succeed and end rewriting...
        RewriteCond             %{REQUEST_URI}  /graphics       [OR]
        RewriteCond             %{REQUEST_URI}  /posters       [OR]
        RewriteCond             %{REQUEST_URI}  /trailers       [OR]
        RewriteCond             %{REQUEST_URI}  /javascript
        RewriteRule             ^(.*)$          -               [L]

        RewriteCond     %{REQUEST_URI}  /favicon
        RewriteRule     ^(.*)$  /graphics/favicon.ico   [L]

        RewriteRule     ^(.*)$ /main.php?%{REQUEST_URI}
</VirtualHost>


Note that you can have both of these definitions in a single file. So I tend to put everything related to (a certain domain) in a single file, called, cleverly, (that domain).inc.

After you've created/edited/deleted your include files, issue an apcycle from the command line and you're up.

Hope this kicks you off in the right direction.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
mightycitizen
Rookie
**
Offline Offline

Posts: 27


View Profile
« Reply #4 on: January 10, 2012, 02:54:00 PM »

thx for ure help perk. ..well i practiced for couple of months with basic commands but still see my notes and run those commands Grin. i only know how apache works along with http.conf as i played with xampp.other than that iam dummy in linux ...

but perk what you mean by

Quote
I tell httpd.conf to include everything with a .inc suffix.

u mean config file for each site in .inc ?
Logged

No links in signatures please
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10009



View Profile
« Reply #5 on: January 11, 2012, 02:36:48 PM »

Yes. The last line in my httpd.conf file is
Include /usr/local/apache2/conf/sitefiles/*.inc 
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!