Donnerstag, 31. Juli 2008

Port forwarding on Router

Port Forwarding Steps for the SMC Barricade G

1. Log into your router. Usually the URL is http://192.168.2.1/ and the password is what you chose when you first set it up. Consult the manual if you have never set it up before or need to reset the password.

2. Choose "Advanced Setup"

3. Choose "NAT" (Network Address Translation)

4. Choose "Virtual Server"

5. Add an entry with "LAN IP Address" 192.168.2.11, "Protocol Type" TCP&UDP, "LAN Port" 80, "Public Port" 80, and the "Enable" box checked. This assumes you gave your server - that is, the computer that you're forwarding connections to - the static local IP address 192.168.2.11. If you don't understand this, first follow the steps in my article how do I give my computer a static local IP address?

6. Click "Add." Forwarding should begin immediately.

http://www.boutell.com/newfaq/creating/forwardports.html
http://www.new2chat.com/router.html

Apache2

1. Install http
2. Activate Apache as a service in the runlevel editor
3. Install apache2-mod_perl for Perl
4. To read the manual type:
http://localhost/manual
5. Apache can be configuredunder:
/etc/apache2/httpd.conf
6. Add the Variable
APACHE_CONF_INCLUDE_FILES
then make a file httpd.conf.local
In this way changes to the configuration are retained in the file
/etc/apache2/httpd.conf is overwriten during new installation.
7. Activate Modules under APACHE_MODULES this variable is defined in
/etc/sysconfig/apache2
8. Error log
/var/log/httpd/error.log




Test Apache:
http://localhost/

I got the 403 error.
Then Go To
DocumentRoot at directory:

/srv/www/htdocs

change own of index.html to the user
e.g chown me.users index.html

ddclient

su
password
ddclient -force
---
protocol=dyndns2
server=members.dyndns.org
use=web, web=checkip.dyndns.org/
login=myAccountName
password=myPassword
wildcard=no
myName.homelinux.com


-------------------
This doesn' work

daemon=300
syslog=yes
mail=root
mail-failure=root
pid=/var/run/ddclient.pid
ssl=yes
protocol=dyndns2
server=members.dyndns.org
login=dyndns.org-username
password=dyndns.org-password
wildcard=no
myhostname.homelinux.com,myhosname2.domainname.tld,myhostname3.domainname.tld

How to configure ddclient according to my configuration

server=members.dyndns.org
protocol=dyndns2
use=web, web=checkip.dyndns.org/
login=myname
password=mypassword
wildcard=no
myname.homelinux.com

---------

Mittwoch, 30. Juli 2008

mySQL Files

MySQL files are found under:
/var/lib/mysql/
they have extention *.frm

Name-based Virtual Host Support

httpd.conf file is found under
/etc/apache2/
-------------------
I have added the following to my httpd.conf file:


NameVirtualHost *:80


ServerName marei.homelinux.com
ServerAlias marei.homelinux.com
DocumentRoot /srv/www/htdocs/



ServerName medicine.homelinux.com
DocumentRoot /srv/www/htdocs/phpBB3/


---------------------
then type to restart apache2:

rcapache2 restart or
/etc/init.d/apache2 restart

####################################
Using Name-based Virtual Hosts
Related Modules Related Directives



* DocumentRoot
* NameVirtualHost
* ServerAlias
* ServerName
* ServerPath
*

To use name-based virtual hosting, you must designate the IP address (and possibly port) on the server that will be accepting requests for the hosts. This is configured using the NameVirtualHost directive. In the normal case where any and all IP addresses on the server should be used, you can use * as the argument to NameVirtualHost. If you're planning to use multiple ports (e.g. running SSL) you should add a Port to the argument, such as *:80. Note that mentioning an IP address in a NameVirtualHost directive does not automatically make the server listen to that IP address. See Setting which addresses and ports Apache uses for more details. In addition, any IP address specified here must be associated with a network interface on the server.

The next step is to create a block for each different host that you would like to serve. The argument to the directive should be the same as the argument to the NameVirtualHost directive (ie, an IP address, or * for all addresses). Inside each block, you will need at minimum a ServerName directive to designate which host is served and a DocumentRoot directive to show where in the filesystem the content for that host lives.
Main host goes away

If you are adding virtual hosts to an existing web server, you must also create a block for the existing host. The ServerName and DocumentRoot included in this virtual host should be the same as the global ServerName and DocumentRoot. List this virtual host first in the configuration file so that it will act as the default host.

For example, suppose that you are serving the domain www.domain.tld and you wish to add the virtual host www.otherdomain.tld, which points at the same IP address. Then you simply add the following to httpd.conf:

NameVirtualHost *:80


ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain



ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain


You can alternatively specify an explicit IP address in place of the * in both the NameVirtualHost and directives. For example, you might want to do this in order to run some name-based virtual hosts on one IP address, and either IP-based, or another set of name-based virtual hosts on another address.

Many servers want to be accessible by more than one name. This is possible with the ServerAlias directive, placed inside the section. For example in the first block above, the ServerAlias directive indicates that the listed names are other names which people can use to see that same web site:

ServerAlias domain.tld *.domain.tld

then requests for all hosts in the domain.tld domain will be served by the www.domain.tld virtual host. The wildcard characters * and ? can be used to match names. Of course, you can't just make up names and place them in ServerName or ServerAlias. You must first have your DNS server properly configured to map those names to an IP address associated with your server.

Finally, you can fine-tune the configuration of the virtual hosts by placing other directives inside the containers. Most directives can be placed in these containers and will then change the configuration only of the relevant virtual host. To find out if a particular directive is allowed, check the Context of the directive. Configuration directives set in the main server context (outside any container) will be used only if they are not overridden by the virtual host settings.

Now when a request arrives, the server will first check if it is using an IP address that matches the NameVirtualHost. If it is, then it will look at each section with a matching IP address and try to find one where the ServerName or ServerAlias matches the requested hostname. If it finds one, then it uses the configuration for that server. If no matching virtual host is found, then the first listed virtual host that matches the IP address will be used.

As a consequence, the first listed virtual host is the default virtual host. The DocumentRoot from the main server will never be used when an IP address matches the NameVirtualHost directive. If you would like to have a special configuration for requests that do not match any particular virtual host, simply put that configuration in a container and list it first in the configuration file.
top
http://httpd.apache.org/docs/2.0/vhosts/name-based.html
http://httpd.apache.org/docs/2.0/vhosts/examples.html
--------------------------------

Dienstag, 29. Juli 2008

Advertisements in phpBB3

One frequently asked question is how to add ads in phpBB3 Olympus. The short answer is very simple: start your favourite text editor and open the correct .html template file. But which template file? Here's the longer answer....
First, open your favourite text editor and then....
Ads in the header
If you want ads in your header, open styles/prosilver/template/overall_header.html and add your code at the very end of the file.
Ads in the footer

If you want ads in your footer, open styles/prosilver/template/overall_footer.html
Find:
Code: Select all

{L_ACP}

Add your code after that line. You may need to include one or two
to get line breaks (newlines) if you so desire.

Important note: Check with your ad provider before you put your ads in the header or footer. Some providers (like Google AdSense) only allow ads on pages that have actual content like the view topic or view forum pages.

Ads in view forum page

If you want ads in the view forum page that lists all the topics in that forum, open styles/prosilver/template/viewforum_body.html and add your code after this line:

Code: Select all


Ads before or after the first post in a topic

If you want ads either before or after the first post in a topic, open styles/prosilver/template/viewtopic_body.html

For ads before the first post, find the line below and add the sample code after this line.
Code: Select all

For ads after the first post, find the line below and add the sample code before this line.
Code: Select all

Here is the sample ad code:
Code: Select all





{postrow.POST_SUBJECT}


Sponsor




Insert your ad code here





Sponsor


 









Of course, replace Insert your ad code here with the ad code your provider gives you.
Ads that blend in with the proSilver style
If you want your ads to blend in with proSilver and have a nice blue background with rounded corner images (note: this is not needed if you followed the instructions above for adding the advertisement before or after the first post in a topic), then use this code in any template file where you want your ads to appear:

Code: Select all




Insert your ad code here








Of course, replace Insert your ad code here with the ad code your provider gives you.

If you have any suggestions or find in bugs with this article, please send me a Private Message.

http://www.phpbb.com/kb/article/advertisements-in-phpbb3/
http://forums.digitalpoint.com/showthread.php?t=358338
http://www.phpbb.com/community/viewtopic.php?t=306680
http://www.webmasterworld.com/forum89/2593.htm

phpBB Installation

1. Quick install

If you have basic knowledge of using FTP and are sure your hosting service or server will run phpBB3 you can use these steps to quickly get started. For a more detailed explanation you should skip this and go to section 2 below.

1. Decompress the phpBB3 archive to a local directory on your system.
2. Upload all the files contained in this archive (retaining the directory structure) to a web accessible directory on your server or hosting account.
3. Change the permissions on config.php to be writable by all (666 or -rw-rw-rw- within your FTP Client)
4. Change the permissions on the following directories to be writable by all (777 or -rwxrwxrwx within your FTP Client):
store/, cache/, files/ and images/avatars/upload/.
5. Using your web browser visit the location you placed phpBB3 with the addition of install/index.php or pointing directly to install/, e.g. http://www.mydomain.com/phpBB3/install/, http://www.mydomain.com/forum/install/ etc.
6. Click the INSTALL tab, follow the steps and fill out all the requested information.
7. Change the permissions on config.php to be writable only by yourself (644 or -rw-r--r-- within your FTP Client)
8. phpBB3 should now be available, please MAKE SURE you read at least Section 6 below for important, security related post-installation instructions.

If you experienced problems or do not know how to proceed with any of the steps above please read the rest of this document.
http://localhost/phpBB3/install/index.php
http://www.sitepoint.com/article/build-a-phpbb-forum
http://www.phpbb.com/community/docs/INSTALL.html#quickinstall
http://www.phpbb.com/support/documents.php?mode=install&version=3&sid=2af41b922be5dbf0274db2ccf2ea6f12

Sonntag, 20. Juli 2008

MySQL: Sort by Column

SELECT * FROM ORDER BY ;
SELECT column1, column2 FROM tablename ORDER BY column1;
SELECT id, row3, row2, row1 FROM bleat;

http://forums.mysql.com/read.php?108,86129,86129
http://dev.mysql.com/doc/refman/5.0/en/sorting-rows.html

MySQL: Locate Directory

1. To find mySQL Databases:
find / -name *.frm -print
result: /var/lib/mysql/

Samstag, 19. Juli 2008

MySQL: Insert A Column

//Add a column & Primary key
alter table Generic, add (id_generic int not null auto_increment primary key);

ALTER TABLE contacts ADD email VARCHAR(60);


This first statement will add the email column to the end of the table. To insert the new column after a specific column, such as name, use this statement:

ALTER TABLE contacts ADD email VARCHAR(60) AFTER name;


If you want the new column to be first, use this statement:

ALTER TABLE contacts ADD email VARCHAR(60) FIRST;


http://www.tech-recipes.com/mysql_tips378.html

Samstag, 12. Juli 2008

Installing Oder of Web Applications

1. Apache
2. MySQL
3. PHP

MySQL Commands: create and Load

create table Generic(generic varchar(50), trade varchar(50), mechanism text, uses varchar(50));
load data infile '/path/my/file.txt' into table generic;
http://sql-info.de/mysql/examples/CREATE-TABLE-examples.html

mySQL: Add user

grant all on *.* to user@localhost identified by 'password';

*.*: user can access all databeses and tables
customer.*: user can access only customer database
customer.address: user can only access cutomer database and address table

user@localhost: the user must be a on the local host.
user : user can access from any where

mySQL: Change Password

mysqladmin command to change root password

If you have never set a root password for MySQL, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows:

$ mysqladmin -u root password NEWPASSWORD

However, if you want to change (or update) a root password, then you need to use following command

$ mysqladmin -u root -p oldpassword newpass

Enter password:
Change MySQL password for other user

To change a normal user password you need to type (let us assume you would like to change password for vivek):

$ mysqladmin -u vivek -p oldpassword newpass

Changing MySQL root user password using mysql sql command

This is another method. MySQL stores username and passwords in user table inside MySQL database. You can directly update password using the following method to update or change password for user vivek:

1) Login to mysql server, type following command at shell prompt:

$ mysql -u root -p

2) Use mysql database (type command at mysql> prompt):

mysql> use mysql;

3) Change password for user vivek:

mysql> update user set password=PASSWORD("NEWPASSWORD") where User='vivek';

4) Reload privileges:

mysql> flush privileges;
mysql> quit

This method you need to use while using PHP or Perl scripting.
http://www.cyberciti.biz/faq/mysql-change-root-password/

MySQL

shell> mysql -h host -u user -p
Enter password: ********

http://dev.mysql.com/doc/refman/5.0/en/connecting-disconnecting.htmlhttp://dev.mysql.com/doc/refman/5.0/en/connecting-disconnecting.html