Hello peeps,
If you are having a proxy server between you and your svn repository and the proxy server has an ip restriction, this problem can happen to you.
Lets say you have a project in url http://example.com/svn/reponame/trunk/project. And you wanna share it with a third party. But can't since, they are reporting of error
Server sent unexpected return value (405 method not allowed) in response to PROPFIND /svn/reponame/!svn/vcc/default
Well the problem is mainly because, your proxy server does not allow the users to go throght /svn/reponame And rather than proxying the request to your svn server, it immediately answers with a not allowed response.
Naturally, you dont want http://example.com/svn/reponame to be seen/listed by any other outsider since there may be other projects which you dont wanna share the source code.
So, you dont put the location /svn/reponame to your locations in the proxy configuration.
But you should. yeah.
SVN access file and ip restriction in your proxy will prevent others to see confidential data.
just put
<location /svn/reponame>
...
.
.
</location>
to your proxy config.
Cheers.
Wednesday, 26 December 2012
IPhone/Ipad html container problem (float right)
I have had a strange html problem with iphone/ipad recently. I was designing an html which has a width of 1024px and contains a child div which is floated right. The child div was strangely out of background. It was kind of overflowed.
Well, enuf bla bla. Check this post. It identifies the problem well and gives great solution.
http://stackoverflow.com/questions/12625949/floatright-elements-causing-elements-to-break-outside-of-containers-on-iphone
For my part adding
<meta name="viewport" content="width=1024" />
to head part solved the problem.
Thanks to user1703674 for this great question and Magnus Magnusson for nice and clean explanation.
Cheers
Well, enuf bla bla. Check this post. It identifies the problem well and gives great solution.
http://stackoverflow.com/questions/12625949/floatright-elements-causing-elements-to-break-outside-of-containers-on-iphone
For my part adding
<meta name="viewport" content="width=1024" />
to head part solved the problem.
Thanks to user1703674 for this great question and Magnus Magnusson for nice and clean explanation.
Cheers
Wednesday, 12 December 2012
Internet explorer - JQuery Ajax Caching Problem
In order to prevent caching ajax calls for IE 9, just add the following JQuery line to your js.
$.ajaxSetup ({cache: false});
Thanks to http://viralpatel.net/blogs/ajax-cache-problem-in-ie/ for this valuable information.
Happy Happy
Joy Joy
Saturday, 24 November 2012
Tomcat 6 - UTF 8
If you are having problems with utf-8 charset (lets say Turkish letters) what you need to do is to change the server.xml file located in $TOMCAT_HOME/conf as follows.
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" />
to
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8"/>
In Eclipse Indigo, find the directory named Servers ( the default name ) which is in the same level as other projects in project view. Find the server.xml file and change the above mentioned lines.
Cheers.
Monday, 5 November 2012
rsync local to remote
Example 4. Synchronize Files From Local to Remote
rsync allows you to synchronize files/directories between the local and remote system.
$ rsync -avz /root/temp/ thegeekstuff@192.168.200.10:/home/thegeekstuff/temp/
Centos apache mod_jk
Hi everybody.
Just wanted to share my 2 cents with you in case anyone wants to FFW coupling of Apache and Tomcat with mod_jk (Tomcat connector).
I followed some instructions found on the web but were specific for other distros (like Debian) so I have to improvise a bit. Here is my version:
prerequisites:
Install apache and tomcat using:
yum install httpd*
yum install tomcat*
This way I installed Apache 2.2.15 and Tomcat 6.0.24 from CentOS-6 repo. Default config locations are:
Apache: /etc/httpd/conf & /etc/httpd/conf.d
Tomcat: /etc/tomcat6 & /usr/share/tomcat6
Now for mod_jk:
PART_ONE (installation)
1. download tomcat-connector SOURCE from mirror that can be found on tomcat dwnld pages (I found it here )
2. copy the file (in my case tomcat-connectors-1.2.32-src.tar.gz) to /usr/src/
3. untar it:
4. go to /native subdirectory of untared package lets say SRC_HOME directory
5. now I found instructions to run ./building.sh script which wasn't able to do anything in my case since I missed a bunch of commands used inside. After reading SRC_HOME/native/BUILDING.txt :) I figured out I am not a developer and don't need to run this script but can go directly to running the script ./configure. Of course it reported that I need gcc which I didn't install with the OS initially so:
6. install gcc:
7. check that you have installed httpd-devel and have apxs (Apache eXtension tool) - I had it under /usr/sbin/apxs which was funny since I expected apxs2 which should be used for Apache 2.x
7. anyway I run configuration script using :
and the script finished successfully.
8. compile the stuff:
9. if you are lucky the you get the mod_jk.so file compiled in the SRC_HOME/native/apache-2.0/ directory. I also received a warning after compilation saying: libtool: install: warning: remember to run 'libtool --finish /usr/lib64/httpd/modules' - which I didn't run and I hope it will not hit me in the future like a boomerang :)
10. copy mod_jk.so file to Apache modules directory (in my case usr/lib64/httpd/modules):
11. end of part one :)
PART_TWO (configuration)
1. create workers properties file in Apache configuration directory (/etc/httpd/conf/):
2. put inside following lines (of course modify it per your needs and system settings):
for further reading please visit: Quick HowTo or Apache HowTo
3. I created the sepparate conf file for my mod_jk and put it into /etc/httpd/conf.d location under name myconf.conf.
I could do that since original Apache conf file (/etc/httpd/conf/httpd.conf) has enabled include of external conf files using directive:
4. inside myconf.conf put something like:
Of course there can be many JkMount directives to redirect specific URL's to Tomcat according to your needs.
5. restart Apache
6. end of part two :)
This should now redirect any URL: http//your-apache-server/myTomcatPages/ to Tomcat. Of course don't forget to open connenctions on a 8009 port which tomcat uses to listen to ajp13 calls (defined in server.xml conf file of Tomcat).
Hope it helps someone spend less time to make things work that it took me.
Best regards
Jani
Just wanted to share my 2 cents with you in case anyone wants to FFW coupling of Apache and Tomcat with mod_jk (Tomcat connector).
I followed some instructions found on the web but were specific for other distros (like Debian) so I have to improvise a bit. Here is my version:
prerequisites:
Install apache and tomcat using:
yum install httpd*
yum install tomcat*
This way I installed Apache 2.2.15 and Tomcat 6.0.24 from CentOS-6 repo. Default config locations are:
Apache: /etc/httpd/conf & /etc/httpd/conf.d
Tomcat: /etc/tomcat6 & /usr/share/tomcat6
Now for mod_jk:
PART_ONE (installation)
1. download tomcat-connector SOURCE from mirror that can be found on tomcat dwnld pages (I found it here )
2. copy the file (in my case tomcat-connectors-1.2.32-src.tar.gz) to /usr/src/
3. untar it:
tar xvf /usr/src/tomcat-connectors-1.2.32-src.tar.gz
4. go to /native subdirectory of untared package lets say SRC_HOME directory
cd /usr/src/tomcat-connectors-1.2.32-src/native
5. now I found instructions to run ./building.sh script which wasn't able to do anything in my case since I missed a bunch of commands used inside. After reading SRC_HOME/native/BUILDING.txt :) I figured out I am not a developer and don't need to run this script but can go directly to running the script ./configure. Of course it reported that I need gcc which I didn't install with the OS initially so:
6. install gcc:
yum install gcc*
7. check that you have installed httpd-devel and have apxs (Apache eXtension tool) - I had it under /usr/sbin/apxs which was funny since I expected apxs2 which should be used for Apache 2.x
7. anyway I run configuration script using :
./configure --with-apxs=/usr/sbin/apxs
8. compile the stuff:
make
9. if you are lucky the you get the mod_jk.so file compiled in the SRC_HOME/native/apache-2.0/ directory. I also received a warning after compilation saying: libtool: install: warning: remember to run 'libtool --finish /usr/lib64/httpd/modules' - which I didn't run and I hope it will not hit me in the future like a boomerang :)
10. copy mod_jk.so file to Apache modules directory (in my case usr/lib64/httpd/modules):
cp ./apache-2.0/mod_jk.so /usr/lib64/httpd/modules/
11. end of part one :)
PART_TWO (configuration)
1. create workers properties file in Apache configuration directory (/etc/httpd/conf/):
touch /etc/httpd/conf/workers.properties
2. put inside following lines (of course modify it per your needs and system settings):
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.lbfactor=1
for further reading please visit: Quick HowTo or Apache HowTo
3. I created the sepparate conf file for my mod_jk and put it into /etc/httpd/conf.d location under name myconf.conf.
touch /etc/httpd/conf.d/myconf.conf
I could do that since original Apache conf file (/etc/httpd/conf/httpd.conf) has enabled include of external conf files using directive:
Include conf.d/*.conf
4. inside myconf.conf put something like:
LoadModule jk_module modules/mod_jk.so
JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk_log
JkLogLevel info
JkMount /myTomcatPages/* worker1
Of course there can be many JkMount directives to redirect specific URL's to Tomcat according to your needs.
5. restart Apache
6. end of part two :)
This should now redirect any URL: http//your-apache-server/myTomcatPages/ to Tomcat. Of course don't forget to open connenctions on a 8009 port which tomcat uses to listen to ajp13 calls (defined in server.xml conf file of Tomcat).
Hope it helps someone spend less time to make things work that it took me.
Best regards
Jani
Thursday, 11 October 2012
IPTables - Open port for specific IP
IPTables - Open port for specific IP
Command and Syntax
There seems to be a lot of confusion with this, so I'm going to make this quick any easy. IPtables is a stateful firewall tht is both powerful and efficent. That being said, let's look at how to restrict a port or service to a specific IP or range of IPs. Entering the following at root will allow SSH connections from the first two locations and drop them from everywhere else:
iptables -I INPUT -p tcp -m tcp -s 70.85.189.123 --dport 22 -j ACCEPT
iptables -I INPUT -p tcp -m tcp -s 70.85.189.100/29 --dport 22 -j ACCEPT
iptables -I INPUT -p tcp -m tcp -s 0.0.0.0/0 --dport 22 -j DROP
Remember, if you want this configuration to survive reboots, you will need to use the command iptables-save. Red hat-based systems will store the configuration in the files /etc/sysconfig/iptables.
If you would like to edit this file directly, use the following:
-A INPUT -p tcp -m tcp -s 70.85.189.123 --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp -s 70.85.189.100/29 --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp -s 0.0.0.0/0 --dport 22 -j DROP
Remember, IPtables like most hardware firewalls, uses stateful packet inspection. It will read the rules in order from top to bottom. This is why we put all the allowed networks first and then put in a blanket deny all (0.0.0.0/0). You can enter hosts into IPtables using any of the following formats:
IP address: ex. 70.85.189.123
DNS name: ex. skullbox.net
CIDR: ex. 70.85.189.100/29
DNS name: ex. skullbox.net
CIDR: ex. 70.85.189.100/29
Subscribe to:
Posts (Atom)