Posted by: gerritvisagie on: November 8, 2011
I use 2 packages on my Ubuntu server to have a look at what is going on.
Run it and have a look, it gives you the source ip and ports that are being accessed
Press P to display ports and N for DNS resolution
Personally I prefer it off
You can lookup any suspicious ip addresses with ip-lookup.net/
Now you will have to look for any suspicious ip addresses that should not be accessing especially SSH and using high volumes of data especially any foreign servers accessing your port 25 (SMTP)
Setup smtp authentication or block them off with a fire wall rule (see net section)
If it does not originate from your country or any nabour countries ones its a safe bet to block it, just ensure not to block the new technologies like the blackberry servers that originate from countries like the UK for Africa.
Its installed by default on the server
For a really nice extensive overview visit: https://help.ubuntu.com/community/IptablesHowTo
Firstly How to see if you have any rules on your firewall
iptables –list
If the very first line reads
ACCEPT all – anywhere anywhere
You will have to ensure to use the –I option this writes the rule to the front of the list
Iptables initializes rules from the top so ACCEPT all –anywhere will result in none of your rules below it working
To stop a specific range:
iptables -I INPUT -p tcp -m iprange –src-range 180.0.0.0-180.255.255.255 -j DROP
to block a specific ip use:
iptables -I INPUT -s 180.76.5.0 -j DROP
and to drop a smtp connecter
iptables -I INPUT -s 196.215.3.214 -p smtp –dport 25 -j DROP
Posted by: gerritvisagie on: October 27, 2011
Cant find the phpmyadmin login of a website you need to backup?
I found myself having this problem with a Joomla website that was about to transfer and a config file with just “Localhost” as the host address. Plus a support center that closed at 5pm sharp. Dont we all just love the bureaucratic way?
I was lucky that i had ftp details. if you dont have the ftp username. Wait for the support center to open… but if you do have the user here is a few quick things you can try to solve your problem.
Try pining the domain by opening command prompt.
run cmd.
type in: ping websiteadress.com
you should get somthing like this:
Now that you have the IP address of the server try typing into your url bar: http://[your.ip.adress]:3306
Some hosts may redirect you to their phpmyadmin page .
Next up try http://88.10.315.138/phpmyadmin/
If your lucky this might also resolve your problem.
What you want to do is use the IP address to log into the SSH command line of the server.
the following commands can be used:
mysqldump -u databaseusername -p –all-databases >alldatabase.sql
Dumps all your databases in the hosting package
mysqldump -u databaseusername -p db_name >alldatabase.sql
for use with specific databases
For a full list of functions: http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
Do not forget the last >filename.sql or else you will only be dumping to screen.
Posted by: gerritvisagie on: July 5, 2011
Ever installed a apache php5 server on ubuntu only to find that it is prompting you to download the pages instead of viewing them?
Well this is because you web server is not recognizing the .php extension.
To enable libapache2-mod-php
Run
sudo a2enmod php
and force reload with
/etc/init.d/apache2 force-reload
If you receve an error where the server says that the librairy could not be found try running
apt-get install libapache2-mod-php5
/etc/init.d/apache2 restart
Another fix if the problem persists:
cd /etc/apache2
Go into mods-available, scroll down to php5.conf and php5.load
Copy php5.conf and php5.load to mods-enabled:
cp php5.conf etc/apache2/mods-enabled
cp php5.load etc/apache2/mods-enabled
After that Restart your Web-server
sudo /etc/init.d/apache2 restart
Posted by: gerritvisagie on: April 13, 2011
Tired of always using http://localhost/mysite ? want it to display mysite.com?
Well same here fellow Apache users.
Brows to your apache folder
>apache>conf>extra
Edit the httpd-vhosts.conf and add the following
(make sure to use the forward slash and not just copy and paste form the clipboard )
NameVirtualHost yourwebsite.com:80
<VirtualHost yourwebsite.com:80>
DocumentRoot C:/root/of/your/site
ServerName yourwebsite.com
</VirtualHost>
Make sure to also add your localhost to ensure your phpmyadmin and other extentions still work.
NameVirtualHost localhost:80
<VirtualHost localhost:80>
DocumentRoot C:/xampplite/htdocs
ServerName localhost.com
</VirtualHost>
Next up on your local drive go to:
C:\Windows\System32\drivers\etc
And edit the hosts file to look like this
127.0.0.1 localhost
127.0.0.1 yourwebsite.com
(Note do not define any real website addresses, this is your computers host setup file and will direct all references to the defined domain to the local machine)
Last and not least make sure your appache httpd.conf allows you to view files in the directory by adding
<Directory “C:/root/of/your/site/”>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Note: Do not use any unsafe characters in folder names. If your apache does not start up after the changes, check the folder names for any spaces an spelling mistakes .