Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Monday, May 7, 2012

Installing Piwik

Piwik is an open source website traffic analysis. I decided to give it a try over google analytics, one of the reasons is because the data can be stored on my server if I choose to and its fast.

Installation was simple, one may be confused by different piwik has such as a plugin for wordpress and the actual source. The plugin for wordpress is only an integration that cannot be used by itself but with the actual source installation. Piwik can be installed on any server and it doesn't need to be inside wordpress directory. Below is a non-english video which shows how to install it. What he says is not important.

Friday, April 27, 2012

Server showing IP address in URL?

To link the domain name to your server the A (address) at the DNS site (eg. namecheap.com) needs to point to your public server IP address. Recently I was having an issue with my site because when I typed baligena.com it went to the site however when I click on a link it would be replace by my IP address in the URL. It's funny when you call for tech support its a waste of time because this shit is too advanced and they won't be able to help you. What I figured out it wasn't the domain name nor the server that was causing this error but Wordpress. Wordpress has an option to specify your site URL.

Wednesday, April 25, 2012

Point Domain Name to your Server

My domain names are hosted by namecheap.com after I decided to make a switch out of godaddy.com. However, I never got around to point my domain name to my server instead I had a simple webpage redirect. Below is a conversation I had with their support team where they explain to me what types of re-directions are and how configure it.

You are now chatting with Natalie Z. - Domains Support
21:47Natalie Z.: Hello, you've contacted Live Support! How can I help you today?
21:48kaka: I have a server where my website is located. I'm trying to use my domain name
21:50kaka: I'm basically trying to forward the domain name not a redirect. How do I do that
21:51Natalie Z.: What exactly you wish to configure on our side? Change nameservers? Create some host record? Create URL redirect?
21:52kaka: What is the difference between changing nameservers and URL redirect
21:55Natalie Z.: If you change the nameservers, you will delegate domain's zone file to the side of your hosting provider and you will need to manage host records there. If you set up URL redirect, you just make the domain redirect to other one, the nameservers are not changed, host records are managed on our side. Changing nameservers will give you some options on the side of your hosting provider to manage your domain there
21:56kaka: I have my server IP address and I want my domain name to direct me to it. But I dont want masking redirect but an actual change. Do understand what I mean?
21:57Natalie Z.: If you need to point your domain to IP address, you need to do the following
21:58Natalie Z.: Go to My Account -> Manage Domains, click on the domain and after the page refreshes choose All Host Records at the left side menu.
21:58Natalie Z.: You need to enter your IP address (xxx.xxx.xxx.x) for both the www and the @ fields and choose A (Address) as the Record Type from the drop down menu. Save changes
21:59kaka: what is the difference between A(address) and URL Redirect
22:01Natalie Z.: A (address) record should be created when you want to associate your domain or subdomain with IP address. URL redirect is used when you just want your visitors type the name of your domain in the address bar and being redirected to any specific web page
22:02kaka: what do i put in for TTL?
22:03Natalie Z.: You can put 1800 as a default value
22:06kaka: If I wanted direct to a specific location in my server like xxx.xxx.xxx.x/myfolder is this posible?
22:07Natalie Z.: Unfortunately, with A record it is not possible
22:07Natalie Z.: This should be configured on your server directly
22:09kaka: How long will it take for the changes to take effect?
22:10Natalie Z.: The changes will take effect within 30 minutes
22:10kaka: ok thank you

Wednesday, April 11, 2012

SSH in Windows

One might ask "why do you need ssh?" And if you don't know what ssh is, learn it? It's very useful, you'll thank me someday.

The problem I was having is that ssh is shipped with Unix operating systems such as Linux and iOS but not on Windows. What if I need to securely access my files on my Windows computer, what will I do? No worries you can have ssh on on Windows but it takes extra work. You'll need to install cygwin a Unix-like environment and command-line interface for Windows. Click Me for detailed instructions on how to set it up.

Monday, February 13, 2012

3rd Party Suck!

Don't store files in 3rd party servers! I knew it, look at megaupload was taken down with people files that were legal. That's why you need a personal server for storing important files to avoid these pitfalls. Now many are left with their thumb in their mouth because their work sank with the ship, it's at the bottom of the ocean and good luck trying to get it back.

I've seen web developers put their development source code in dropbox. Yes, it syncs with your other computers but seriously how safe is it to have it out there.

Think about it...

What happens if dropbox gets hacked, I never trust these 3rd party companies saying they delete your stuff. 3rd Parties are infamous in not telling what they do with your information. Someone once told me "its not how safe you are with your information but how safe others are."

Setting up your own server is not difficult, especially with technology getting cheaper. With a little knowledge of Linux, an old computer(or buy one for $70) and with the information on this site you can get it started.

The Benefits:
Not only does it pay for itself in the long run (hosting cost) it also gives you the freedom to customize it with software and hardware. It also give you control with the security. You'll will be able to access your files from anywhere thru ssh, ftp, http and so on. And best of all you'll learn alot.

To get started click this and this.

Sunday, February 5, 2012

Using git with restricted server/godaddy

You cannot install git on your godaddy hosting server. The alternative would be to connect godaddy server to your computer that already has git installed. What we will be doing is mounting the server folder to a folder on your computer using sshfs. This enables you to run programs installed on your computer for remote servers. (I'm using Ubuntu 11.10)

$ sudo apt-get install sshfs
#$ sshfs hostDirectory computerDirectory
$ sshfs username@hostname:/ ~/Desktop/mount
$ cd mount

# to unmount
$ sudo umount /path #its umount not unmount command


reference:
http://www.howtogeek.com/howto/ubuntu/how-to-mount-a-remote-folder-using-ssh-on-ubuntu/

Saturday, January 28, 2012

ssh from anywhere

I have no trouble accessing my server inside my home from my laptop because I'm local (in the same wifi) but if I decide that I need to access my server from at a coffee shop thorough my ipaddress here is how I do it.

First make sure that ssh is install on your linux machine and you can access ssh locally.

All is need is to port forward the range 22 by accessing your router. That's it!

Now you can
$ ssh username@ipaddress





linux, ubuntu, putty, ssh anywhere port 22 connection refused port forwarding

Wednesday, July 20, 2011

Working with .htaccess

What is .htaccess:
.htaccess (hypertext access) is the default name of a directory-level configuration file that allows for decentralized management of web server configuration. -Wikipedia

.htaccess is a way to modify the web server without editing the Master file.

In Apache the master file is called httpd.conf

How to create 404 and 403 pages:
404 pages appear when it doesn't exist (alternative to index.html in every directory on site) and 403 is a page exist but is forbidden to access.

In order for .htaccess to work you need to configure httpd.conf
AllowOveride must be set to All. See below. Remember its case sensitive. For some reason apache ships as "all" instead of a capitalized "All".

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All

What to put in .htaccess:
ErrorDocument 404 /yourerrorpage.html
ErrorDocument 403 /yourerrorpage.html

# Options -Indexes is what allows the 403 error to work
Options -Indexes


If you don't want to use .htaccess you can simply put
ErrorDocument 404 http:yourerrorpage.html
ErrorDocument 403 /yourerrorpage.html

Warning: Make sure you always restart Apache when changes are made to the httpd.conf because the changes won't be taken into effect until you do

You must edit httpd.conf at the server, you can't use ftp unless it's not secured. It should be located at /etc/apache2/httpd.conf



How to rewrite URLs?
To manipulate your links like transfroming ?name=page&URL's into /friendly/cute/links
you must activate rewrite_module in Apache.

Left click on the wamp icon then hover over "Apache" and go to "Apache Modules" and click on rewrite_module (or mod_rewrite) so it has a check. (or 500 Internal Server Error may throw)

or open httpd.conf and uncomment(remove #) the line below
LoadModule rewrite_module modules/mod_rewrite.so

Wait for Apache to restart.

In .htaccess insert this code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) mvc/index.php/$1

------or-------

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

More information:
http://corz.org/serv/tricks/htaccess2.php

Good MVC clean URL video


_________________________________________________
Ubuntu sever 11.10
Now the mod rewrite is a little different in the Ubuntu server. You have to create a "rewrite.load" symlink from /etc/apache2/mods-available to /etc/apache2/mods-enabled by running:
$ sudo a2enmod rewrite
then edit:
$ sudo nano /etc/apache2/sites-available/default
and make line 11 to AllowOverride None to AllowOverride All, see snippet below

<Directory /home/marko/public_html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>


then restart apache:
$ sudo service apache2 restart

reference: http://www.techytalk.info/enable-apache-mod_rewrite-on-ubuntu-linux/


description: mod_rewrite wamp, .htaccess issue (500 - Internal Server Error), .htaccess apache mvc configuration 500, redirecting and rewriting

Saturday, June 4, 2011

Making your server accessible to the internet (outside your own network).

If you want to see a prettier version of this post with pictures and color coding (part of this post won't make sense if you don't see the pictures) click on the link below to view the pdf format
setting up your server.pdf

There are two types of IP address. I like to call it the internet ip address and the server ip address. The way it works is that the internet ip address points to the server ip address. The INTERNET cannot access your server directly but can access your internet ip address.

Figure:
This works
INTERNET(The world)->your internet ip address ->your server ip address

This doesn’t work
INTERNET(The world)->your server ip address

To find your internet ip address go to http://myipaddress.com

Your server ip address is what you created with Ubuntu or any server.

To point your internet ip address to your server ip address you need to access your router. You do this by typing 192.168.1.1 in browser (for Linksys, it may be different if you have a different router). What we will be doing is Port Forwarding.

In Applications & Gaming-> Port Range Foward

Applications-> can be anything you want
Start and End-> needs to be 80
Protocol->needs to be Both (TCP & UDP)
IP Address -> need to be your server IP

Save and exit

That’s it . Type your internet ip address in the browser. It will now direct you to your server.

Connect using domain name
I purchased my domain from godaddy
All were doing is connecting a domain name to the internet ip address

Log into godaddy.com account
Select the domain name you want to use
And access you Domain Manager
Click Launch where it says DNS Manager



Put your internet ip address (not the server) under Points To (next to Host) where its highlighted in blue


Then save

Now when you type your domain name it will take you to your site

Figure:
INTERNET(The world)->Domain Name->your internet ip address->your server ip address


You did it!!!
Thumbs up Everybody for Rock and Roll

Wednesday, June 1, 2011

How to set up Static IP address for Server

Its good practice to give your server a static IP address because
1. You don't always need to reconfigure your router
2. It's easy to do

Click on the link below for a full explanation

http://www.howtogeek.com/howto/ubuntu/change-ubuntu-server-from-dhcp-to-a-static-ip-address/

PS. It's not true that you need a static IP address for the world to access you website from you server. You can also use a dynamic (DHCP), which is the default when you set up your Ubuntu server.

For more infomation on Making your server accessible to the internet