What Does This Rewrite Rule Actually Do?

When looking at .htaccess on our server, I see that the developers included the following lines:

RewriteRule (services/.*) $1 [L] # adjust the regex to what you want.
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]

No idea what the first RewriteRule actually does
Not sure about the ^$ in the 2nd rule
I understand the 3rd rule.


I would appreciate a quick explanation. Thank you very much in advance.


Similar Content



500 Internal Server Error When Using The Mod_rewrite

Hello.

I have such links in a web site

/post.php?id=14
/cat.php?t=y&cid=6666

and i create an .htaccess file with that content inside.

Code:
Options +FollowSymLinks 
RewriteEngine On 
RewriteRule ^([^/]*)$ /post.php?id=$1 [L] 
RewriteRule ^([^/]*)/([^/]*)$ /cat.php?t=$1&cid=$2 [L]

but on refresh, apache returns 500 Internal server error.

I looked on logs and found that :
Quote:
AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Why that happens ? Mod_rewrite is enabled in httpd.conf.

SQUID NOT ALLOWING BROWSING FOR SECURED CONNECTION

SIR

I HAVE RECENTLY INSTALLED CENTOS7 AND CONFIGURED SQUID ON IT . I AM FACING A TYPICAL PROBLEM I AM ABLE TO BROWSE THE NORMAL PAGES BUT WHEN ANY PAGE THAT STARTS WITH HTTPS:\\ IS NOT ALLOWED TO BROWSE.
I HAVE CHECKED MY SQUID.CONF FILE BUT AM UNABLE TO FIND THE PROBLEM.
I HAVE DISABLE SELINEX AND THERE ARE NO RULES IN IPTABLES ALSO.

KINDLY HELP

PASTING MY SQUID.CONF FILE

#
# Recommended minimum configuration:
#

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
#acl all src all
#acl manager proto cache_object
#acl localhost 127.0.0.1/32
#acl to_localhost dst 127.0.0.0/8 0.0.0.0/32

acl localnet src 191.254.178.0/24 191.254.28.0/24 10.0.43.0/24 10.0.42.0/24
http_access allow localnet
icp_access allow all

acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT

#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
#http_access allow localhost manager
http_access allow localnet manager
http_access deny manager

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
#http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all


# Squid normally listens to port 3128
http_port 8899

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

cache_peer 191.254.178.76 parent 3128 0 no-query no-digest
#icp_access allow all

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp: 1440 20 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320

IPtables Rules Are Not Working In RHEL- 6.5 And It Was Working In RHEL5.9

Hi Friends,

I have migrated from RHEL-5.9 to RHEL-6.5 on my server. But iptables rules are not working in RHEL-6.5 as it is working with RHEL-5.9 with the same rules. Please check my rules and details are below.

eth1 for incoming traffic
ppp0,ppp1,ppp2 and ppp3 are DSL connection and it using for outgoing traffic.

I am able to send the traffic through each line separately but could not load-balance with all ppp interfaces through iptables.

I am using iptable mangle rules to distribute the traffic.

/sbin/iptables -t mangle -A OUTPUT -p tcp -m statistic --mode nth --every 4 --packet 0 -m tcp --tcp-flags FIN,SYN,ACK SYN -j MARK --set-mark 1
/sbin/iptables -t mangle -A OUTPUT -p tcp -m statistic --mode nth --every 4 --packet 1 -m tcp --tcp-flags FIN,SYN,ACK SYN -j MARK --set-mark 2
/sbin/iptables -t mangle -A OUTPUT -p tcp -m statistic --mode nth --every 4 --packet 2 -m tcp --tcp-flags FIN,SYN,ACK SYN -j MARK --set-mark 3
/sbin/iptables -t mangle -A OUTPUT -p tcp -m statistic --mode nth --every 4 -m tcp --tcp-flags FIN,SYN,ACK SYN -j MARK --set-mark 4

/sbin/ip route add table ppp0 default dev ppp0
/sbin/ip route add table ppp1 default dev ppp1
/sbin/ip route add table ppp2 default dev ppp2
/sbin/ip route add table ppp3 default dev ppp3

/sbin/ip rule add fwmark 1 pref 200 table ppp1
/sbin/ip rule add fwmark 2 pref 200 table ppp2
/sbin/ip rule add fwmark 3 pref 200 table ppp3
/sbin/ip rule add fwmark 4 pref 200 table ppp0

/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
/sbin/iptables -t nat -A POSTROUTING -o ppp1 -j MASQUERADE
/sbin/iptables -t nat -A POSTROUTING -o ppp2 -j MASQUERADE
/sbin/iptables -t nat -A POSTROUTING -o ppp3 -j MASQUERADE

/sbin/ip route app default equalize nexthop dev ppp0 nexthop dev ppp1 nexthop dev ppp2 nexthop dev ppp3

It was not working completely and after read some article to change the kernel parameter I am able to send the traffic but it is working only for some time and dropping connections without any errors.

"echo 2 > /proc/sys/net/ipv4/conf/default/rp_filter
"echo 2 > /proc/sys/net/ipv4/conf/all/rp_filter"
"net.ipv4.conf.default.rp_filter = 2"

The same rules were working perfectly in RHEL-5.9. Do i need to change any other kernel parameter get this done?

Please let me know what are the kernel parameters have to be changed to get this working as like RHEL-5.9 ?

Thanks,
Sekar

Restrictive Iptables Rule For DHCP

I was reading the frozentux appendix for dhcp (https://www.frozentux.net/iptables-t...tml/x6316.html) and I was wondering how could this Code:
$IPTABLES  -I INPUT -i $LAN_IFACE -p udp --dport 67:68 --sport 67:68 -j ACCEPT

be made to be more restrictive? The author himself says that this ca be done, but doesn't give any details in this respect.

I am interested in both cases - if the computer is a dhcp server or if it is only a dhcp client. Can you help me out with this?

.profile And Bash.rc

hi guys

i was taught that /etc/profile was global for environmental variables and settings...and ~/.profile was specific to the user...

and that bash.rc and ~/.bash.rc was for aliases and functions...i was trying to setup a permanent alias in my profile to a common ssh command and read that it should be going into .profile??? is it really not strict or just a rule of thumb?

Mint Or Ubuntu?

Sorry if this has been discussed, im inclined to believe it has. Im getting that new machine on Friday and plan to create the partition immediately and install either one, i only said Ubuntu because i havent tried Mint (yet).

So would you mind telling me why you like Mint or why you like Ubuntu and why you prefer the one over the other. I will download some Mibt ISO's tomorrow, i have plenty Ubuntu's, CentOS, OpenSUSE, Kali, Gentoo and a cple others, just not Mint..

Also, i am in MPLS/St Paul, willing to pay for some help to tutor me around a couple config issues (cash-in person, perhaps a coffee shop meeting. (I hope thats not breaking a rule, i just need to tweak a cple issues and would love some hands on experience.

Thanks in advance

~cheers
Randy

RHCSA Exam

I am appearing for RHCSA exam next week. I want to ask a simple question. CAN I DELETE FIREWALL RULE in RHCSA exam.

# service iptables stop
# iptables -F
# service iptables save


Any tips/suggestion for RHCSA exam would be really appreciated.


Thanks

Sendmail Alias Not Working

I'm trying to send all root's mails to an external e-mailaddress, but for some reason I can't get it to work.

I've edited /etc/aliases with the following rule:

root: <myexternal@email.address>

and run newaliasses after, which would run without any errors.

I can run: echo "Testing" | mail -s "Server Testing" <myexternal@email.address>
just fine without any issue and it's being delivered correctly to my external address.

But when I run: echo "Testing" | mail -s "Server Testing" root

I (first) get a "Deferred: 451 Temporary local problem - please try again later" error and when I then run: "Sendmail -OTimeout.hoststatus=0m -q -v" to flush the mailqueue it says everything is ok, but I then get a message saying I have new mail in /var/spool/mail/root and I don't get the mail on my external e-mailaddress.

I have no clue where to look next, hopefully you guys can point me in the right direction.

Just for completeness: I use mageia release 4 (x86_x64).

Linux Os Clustering?

Hy,
I am new to linuxquestion.org, however i am mid-level linux administrator.

As per my scenario, I want to cluster python and java services in two nodes running RHEL 6.4. Till now by watching tutorial I have seen application level clustering of linux for eg: webserver, mysql database and so on. However I haven't found any with python & java clustering.
I am already familiar with windows clustering having clustered ip of the two nodes. In my scenario, we have both the options open either going with active-active or active-passive cluster. So I want to some sort of idea to achieve linux os clustering and hence obtained clustered ip.
Further any idea on how this service will float from one node to another. Further, I cannot get to the fencing mechanism in Linux. Any idea for this will be helpful to understand.

Hope to get positive respond ASAP. Thanks in advance for those who help me with this.

Quick GREP Question..

Hey guys,

Something is puzzling me!

I saw someone use the grep in the following way and I'm not sure I understand what it does, and if there's any benefit to using it this way.

Code:
grep X.X.X.X /var/log/log.log | grep -v query

I checked the man file which confirmed that -v is relating to matching non grouping lines (which I'm not sure I fully understand either!) but I don't see any difference in the output of the above command versus the same command without the | grep -v query bit..

Why would you pipe grep into grep unless you were searching for something specific within the search results?

Does query mean something else?