I want to look through my apache access log backwards. How can I do that on Ubuntu?
Tony's questions
I have two svn branches checked out, "b1" and "b2". I would like to merge all of my commits from the "b1" branch onto the "b2" branch. I have tried something like
svn merge -r HEAD:HEAD b1 b2
but it does nothing. I am sure I have this command wrong but I can't find good documentation on it. I would like to do this on the client side and not create a third branch.
Any ideas?
Thanks!
Possible Duplicate:
How to use DNS to redirect domain to specific port on my server
I want to trick my browser into going to localhost:3000 instead of xyz.com. I went into /etc/hosts on OS X 10.5 and added the following entry:
127.0.0.1:3000 xyz.com
That does not work but without specifying the port the trick works. Is there a way to do this specifying the port?
I have a simple script setup:
<?php
mail('[email protected]', 'Hello World', 'Testing a message');
?>
I cannot send email from my server to AOL accounts. The error details are below. GMail lets me send the message...so I guess AOL is just a bit stricter.
Starting tcpick 0.2.1 at 2009-08-03 22:25 UTC
Timeout for connections is 600
tcpick: reading from tcp_dump.pcap
1 SYN-SENT 67.23.28.65:49516 > 64.12.138.153:smtp
1 SYN-RECEIVED 67.23.28.65:49516 > 64.12.138.153:smtp
1 ESTABLISHED 67.23.28.65:49516 > 64.12.138.153:smtp
220-rly-mg05.mx.aol.com ESMTP mail_relay_in-mg05.6; Mon, 03 Aug 2009 18:25:34 -0400
220-America Online (AOL) and its affiliated companies do not
220- authorize the use of its proprietary computers and computer
220- networks to accept, transmit, or distribute unsolicited bulk
220- e-mail sent from the internet. Effective immediately: AOL
220- may no longer accept connections from IP addresses which
220 have no reverse-DNS (PTR record) assigned.
EHLO bandop.com
250-rly-mg05.mx.aol.com fallsroadsunoco.com
250 HELP
MAIL FROM:<www-data@com>
501 SYNTAX ERROR IN PARAMETERS OR ARGUMENTS
RSET
250 OK
QUIT
1 FIN-WAIT-1 67.23.28.65:49516 > 64.12.138.153:smtp
2 SYN-SENT 67.23.28.65:45729 > 216.239.113.101:smtp
1 FIN-WAIT-2 67.23.28.65:49516 > 64.12.138.153:smtp
221 SERVICE CLOSING CHANNEL
1 RESET 67.23.28.65:49516 > 64.12.138.153:smtp
3 SYN-SENT 67.23.28.65:45729 > 216.239.113.101:smtp
tcpick: done reading from tcp_dump.pcap
20 packets captured
3 tcp sessions detected
Do you know how I can make the FROM parameter come out correctly? Setting the FROM header in the PHP mail function does not work.
UPDATE
This little hack is working but I would prefer to fix this issue outside of PHP.
mail('[email protected]', 'Hello World', 'Testing a message', null,'[email protected]');
I am super noob with mail servers
I used Fink to install postgresql on os x. when i try to start psql, i get:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
I have never installed postgresql before so I am not really sure where to look. Have any suggestions?
I have OS X 10.5 with about 40 websites in the Sites directory. I just downloaded one from my server to initialize a local copy but I am getting denied access. The permissions seem fine but Apache is still giving me the 403. Any ideas why this would happen? Does it have to do with me downloading the files from the internet?
drwxr-xr-x 30 TAmoyal TAmoyal 1020 Jul 17 19:45 ./
drwxr-xr-x+ 55 TAmoyal TAmoyal 1870 Jul 17 19:45 ../
-rw-r--r--@ 1 TAmoyal TAmoyal 170 Jul 6 02:40 .htaccess
-rw-r--r-- 1 TAmoyal TAmoyal 397 Jul 2 19:08 index.php
-rw-r--r-- 1 TAmoyal TAmoyal 15129 Jul 2 19:08 license.txt
-rw-r--r-- 1 TAmoyal TAmoyal 7638 Jul 2 19:08 readme.html
drwxr-xr-x 89 TAmoyal TAmoyal 3026 Jul 17 16:24 wp-admin/
-rw-r--r-- 1 TAmoyal TAmoyal 40543 Jul 2 19:10 wp-app.php
-rw-r--r-- 1 TAmoyal TAmoyal 220 Jul 2 19:10 wp-atom.php
-rw-r--r-- 1 TAmoyal TAmoyal 274 Jul 2 19:10 wp-blog-header.php
-rw-r--r-- 1 TAmoyal TAmoyal 3649 Jul 2 19:10 wp-comments-post.php
-rw-r--r-- 1 TAmoyal TAmoyal 238 Jul 2 19:10 wp-commentsrss2.php
-rw-r--r-- 1 TAmoyal TAmoyal 2550 Jul 2 19:10 wp-config-sample.php
-rw-r--r--@ 1 TAmoyal TAmoyal 2458 Jul 17 16:41 wp-config.php
drwxr-xr-x 5 TAmoyal TAmoyal 170 Jul 17 16:25 wp-content/
-rw-r--r-- 1 TAmoyal TAmoyal 1254 Jul 2 19:11 wp-cron.php
-rw-r--r-- 1 TAmoyal TAmoyal 220 Jul 2 19:11 wp-feed.php
drwxr-xr-x 77 TAmoyal TAmoyal 2618 Jul 17 16:29 wp-includes/
-rw-r--r-- 1 TAmoyal TAmoyal 1946 Jul 2 19:14 wp-links-opml.php
-rw-r--r-- 1 TAmoyal TAmoyal 2341 Jul 2 19:14 wp-load.php
-rw-r--r-- 1 TAmoyal TAmoyal 21019 Jul 2 19:14 wp-login.php
-rw-r--r-- 1 TAmoyal TAmoyal 7113 Jul 2 19:14 wp-mail.php
-rw-r--r-- 1 TAmoyal TAmoyal 487 Jul 2 19:14 wp-pass.php
-rw-r--r-- 1 TAmoyal TAmoyal 218 Jul 2 19:14 wp-rdf.php
-rw-r--r-- 1 TAmoyal TAmoyal 316 Jul 2 19:14 wp-register.php
-rw-r--r-- 1 TAmoyal TAmoyal 218 Jul 2 19:14 wp-rss.php
-rw-r--r-- 1 TAmoyal TAmoyal 220 Jul 2 19:14 wp-rss2.php
-rw-r--r-- 1 TAmoyal TAmoyal 21213 Jul 2 19:14 wp-settings.php
-rw-r--r-- 1 TAmoyal TAmoyal 3434 Jul 2 19:14 wp-trackbac
Thanks
a simple cat on the pcap file looks terrible:
$cat tcp_dump.pcap
?ò????YVJ?
JJ
?@@.?E<??@@
?CA??qe?U????иh?
.Ceh?YVJ??
JJ
?@@.?E<??@@
CA??qe?U????еz?
.ChV?YVJ$?JJ
?@@.?E<-/@@A?CAͼ?9????F???A&?
.Ck??YVJgeJJ@@.?Ӣ#3E<@3{nͼ?9CA??P?ɝ?F???<K?
?ԛ`.Ck??YVJgeBB
?@@.?E4-0@@AFCAͼ?9????F?P?ʀ???
.Ck??ԛ`?YVJ?""@@.?Ӣ#3E?L@3?Iͼ?9CA??P?ʝ?F?????
?ԛ?.Ck?220-rly-da03.mx
etc.
I tried to make it prettier with:
sudo tcpdump -ttttnnr tcp_dump.pcap
reading from file tcp_dump.pcap, link-type EN10MB (Ethernet)
2009-07-09 20:57:40.819734 IP 67.23.28.65.49237 > 216.239.113.101.25: S 2535121895:2535121895(0) win 5840 <mss 1460,sackOK,timestamp 776168808 0,nop,wscale 5>
2009-07-09 20:57:43.819905 IP 67.23.28.65.49237 > 216.239.113.101.25: S 2535121895:2535121895(0) win 5840 <mss 1460,sackOK,timestamp 776169558 0,nop,wscale 5>
2009-07-09 20:57:47.248100 IP 67.23.28.65.42385 > 205.188.159.57.25: S 2644526720:2644526720(0) win 5840 <mss 1460,sackOK,timestamp 776170415 0,nop,wscale 5>
2009-07-09 20:57:47.288103 IP 205.188.159.57.25 > 67.23.28.65.42385: S 1358829769:1358829769(0) ack 2644526721 win 5792 <mss 1460,sackOK,timestamp 4292123488 776170415,nop,wscale 2>
2009-07-09 20:57:47.288103 IP 67.23.28.65.42385 > 205.188.159.57.25: . ack 1 win 183 <nop,nop,timestamp 776170425 4292123488>
2009-07-09 20:57:47.368107 IP 205.188.159.57.25 > 67.23.28.65.42385: P 1:481(480) ack 1 win 1448 <nop,nop,timestamp 4292123568 776170425>
2009-07-09 20:57:47.368107 IP 67.23.28.65.42385 > 205.188.159.57.25: . ack 481 win 216 <nop,nop,timestamp 776170445 4292123568>
2009-07-09 20:57:47.368107 IP 67.23.28.65.42385 > 205.188.159.57.25: P 1:18(17) ack 481 win 216 <nop,nop,timestamp 776170445 4292123568>
2009-07-09 20:57:47.404109 IP 205.188.159.57.25 > 67.23.28.65.42385: . ack 18 win 1448 <nop,nop,timestamp 4292123606 776170445>
2009-07-09 20:57:47.404109 IP 205.188.159.57.25 > 67.23.28.65.42385: P 481:536(55) ack 18 win 1448 <nop,nop,timestamp 4292123606 776170445>
2009-07-09 20:57:47.404109 IP 67.23.28.65.42385 > 205.188.159.57.25: P 18:44(26) ack 536 win 216 <nop,nop,timestamp 776170454 4292123606>
2009-07-09 20:57:47.444112 IP 205.188.159.57.25 > 67.23.28.65.42385: P 536:581(45) ack 44 win 1448 <nop,nop,timestamp 4292123644 776170454>
2009-07-09 20:57:47.484114 IP 67.23.28.65.42385 > 205.188.159.57.25: . ack 581 win 216 <nop,nop,timestamp 776170474 4292123644>
2009-07-09 20:57:47.616121 IP 67.23.28.65.42385 > 205.188.159.57.25: P 44:50(6) ack 581 win 216 <nop,nop,timestamp 776170507 4292123644>
2009-07-09 20:57:47.652123 IP 205.188.159.57.25 > 67.23.28.65.42385: P 581:589(8) ack 50 win 1448 <nop,nop,timestamp 4292123855 776170507>
2009-07-09 20:57:47.652123 IP 67.23.28.65.42385 > 205.188.159.57.25: . ack 589 win 216 <nop,nop,timestamp 776170516 4292123855>
2009-07-09 20:57:47.652123 IP 67.23.28.65.42385 > 205.188.159.57.25: P 50:56(6) ack 589 win 216 <nop,nop,timestamp 776170516 4292123855>
2009-07-09 20:57:47.652123 IP 67.23.28.65.42385 > 205.188.159.57.25: F 56:56(0) ack 589 win 216 <nop,nop,timestamp 776170516 4292123855>
2009-07-09 20:57:47.668124 IP 67.23.28.65.49239 > 216.239.113.101.25: S 2642380481:2642380481(0) win 5840 <mss 1460,sackOK,timestamp 776170520 0,nop,wscale 5>
2009-07-09 20:57:47.692126 IP 205.188.159.57.25 > 67.23.28.65.42385: P 589:618(29) ack 57 win 1448 <nop,nop,timestamp 4292123893 776170516>
2009-07-09 20:57:47.692126 IP 67.23.28.65.42385 > 205.188.159.57.25: R 2644526777:2644526777(0) win 0
2009-07-09 20:57:47.692126 IP 205.188.159.57.25 > 67.23.28.65.42385: F 618:618(0) ack 57 win 1448 <nop,nop,timestamp 4292123893 776170516>
2009-07-09 20:57:47.692126 IP 67.23.28.65.42385 > 205.188.159.57.25: R 2644526777:2644526777(0) win 0
Well...that is much prettier but it doesn't show the actual messages. I can actually extract more information just viewing the RAW file. What is the best ( and preferably easiest) way to just view all the contents of the pcap file?
UPDATE
Thanks to the responses below, I made some progress. Here is what it looks like now:
tcpdump -qns 0 -A -r blah.pcap
20:57:47.368107 IP 205.188.159.57.25 > 67.23.28.65.42385: tcp 480
0x0000: 4500 0214 834c 4000 3306 f649 cdbc 9f39 [email protected]
0x0010: 4317 1c41 0019 a591 50fe 18ca 9da0 4681 C..A....P.....F.
0x0020: 8018 05a8 848f 0000 0101 080a ffd4 9bb0 ................
0x0030: 2e43 6bb9 3232 302d 726c 792d 6461 3033 .Ck.220-rly-da03
0x0040: 2e6d 782e 616f 6c2e 636f 6d20 4553 4d54 .mx.aol.com.ESMT
0x0050: 5020 6d61 696c 5f72 656c 6179 5f69 6e2d P.mail_relay_in-
0x0060: 6461 3033 2e34 3b20 5468 752c 2030 3920 da03.4;.Thu,.09.
0x0070: 4a75 6c20 3230 3039 2031 363a 3537 3a34 Jul.2009.16:57:4
0x0080: 3720 2d30 3430 300d 0a32 3230 2d41 6d65 7.-0400..220-Ame
0x0090: 7269 6361 204f 6e6c 696e 6520 2841 4f4c rica.Online.(AOL
0x00a0: 2920 616e 6420 6974 7320 6166 6669 6c69 ).and.its.affili
0x00b0: 6174 6564 2063 6f6d 7061 6e69 6573 2064 ated.companies.d
etc.
This looks good, but it still makes the actual message on the right difficult to read. Is there a way to view those messages in a more friendly way?
UPDATE
This made it pretty:
tcpick -C -yP -r tcp_dump.pcap
Thanks!
I am a bit of an email noob. My website is trying to send email from a contact form using the PHP mail function. This works fine when sending it to my Gmail account, but AOL rejects it. I have set up an RDNS record for the client ( fallsroadsunoco.com )
Macintosh:~ TAmoyal$ nslookup 67.23.28.65
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
65.28.23.67.in-addr.arpa name = fallsroadsunoco.com.
Authoritative answers can be found from:
I have even set up an MX record (although I think this is irrelevant because that should only be needed for receiving email). I did some poking around and randomly saw this on my server...but 2 things to note with this output:
- i changed the receiving email address to [email protected] to keep it anonymous
- bandop.com was my RDNS host name at the time this email was sent. i changed it to the client's host name fallsroadsunoco.com to see if that would help...and it didn't
sudo more var/spool/postfix/deferred/0/0F902E4F7E
trace_flags=0SO^Lwww-data@comR^Lwww-data@comMN!Received: by bandop.com (Postfix)N5124671id 0F902E4F7E; Sat,ime=1246714223Alog_message_origin=localA
4 Jul 2009 13:30:23 +0000 (UTC)N+Date: Sat, 4 Jul 2009 13:30:23 +0000 (UTC)N.From: MAILER-DAEMON@com (Mail Delivery System)N,Subject: Undelivered Mail Returned to SenderNTo: www-data@
comNAuto-Submitted: auto-repliedNMIME-Version: 1.0N<Content-Type: multipart/report; report-type=delivery-status;N, boundary="B68D0E4F7D.1246714223/bandop.com"NContent-Transfer-Enco
ding: 8bitN2Message-Id: <[email protected]>NN$This is a MIME-encapsulated message.NN"--B68D0E4F7D.1246714223/bandop.comN!Content-Description: NotificationN*Content-Ty
pe: text/plain; charset=us-asciiNN+This is the mail system at host bandop.com.NN;I'm sorry to have to inform you that your message could notN<be delivered to one or more recipients. It'
s attached below.NN7For further assistance, please send mail to postmaster.NN9If you do so, please include this problem report. You canN8delete your own text from the attached returned
message.NN" The mail systemNNO<[email protected]>: host mailin-02.mx.aol.com[64.12.137.89] said: 501 SYNTAXND ERROR IN PARAMETERS OR ARGUMENTS (in reply to MAIL F
ROM command)NN"--B68D0E4F7D.1246714223/bandop.comN$Content-Description: Delivery reportN%Content-Type: message/delivery-statusNNReporting-MTA: dns; bandop.comNX-Postfix-Queue-ID: B68D0E
Status: 5.0.0N%Remote-MTA: dns; mailin-02.mx.aol.comNBDiagnostic-Code: smtp; 501 SYNTAX ERRO(UTC)NN,Final-Recipient: rfc822; [email protected]: failedN
IN PARAMETERS OR ARGUMENTSNN"--B68D0E4F7D.1246714223/bandop.comN(Content-Description: Undelivered MessageNContent-Type: message/rfc822NContent-Transfer-Encoding: 8bitNN1Received: by ba
ndop.com (Postfix, from userid 33)N5 id B68D0E4F7D; Sat, 4 Jul 2009 13:30:22 +0000 (UTC)NTo: [email protected]!Subject: Your contact form works!N$Date: Sat, 4 Jul 2009 09:30:22 -
X-Priority: 3N?X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.4]NMIME-Version: 1.0NContent-Transfer-Enallsroadsunoco.com>N
oding: 8bitN)Content-Type: text/plain; charset="UTF-8"NNName: Tony AmoyalN
[email protected]:NCan you see this?NNN$--B68D0E4F7D.1246714223/bandop.com--XA
Any idea why only AOL would be rejecting my messages? Also note that they are not making it to the SPAM folder.
I am working on a website with someone. I want to give them access only to their home directory and the website directory. What is the easiest way to accomplish this? I also don't want this to mess up apache's permissions with the site. I am running Ubuntu.
I configured PHP to look in /etc/php5/apache2 for the php.ini file. the output of phpinfo() says that the path was set correctly, but also says no configuration file was loaded. i changed the php.ini permissions to 777 temporarily to test that issue and permissions are not the issue. what else could the issue be?
When I compiled php, i did:
sudo ./configure --with-apxs2=/usr/sbin/apxs --with-mysql --enable-so --with-config-file-path=/etc/php5/apache2 --sysconfdir=/etc/php5 --with-config-file-scan-dir=/etc/php5/conf.d
phpinfo() says:
Configuration File (php.ini) Path /etc/php5/apache2
Loaded Configuration File (none)
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
Also php --ini says: Configuration File (php.ini) Path: /usr/local/lib Loaded Configuration File: /etc/php5/apache2/php.ini Scan for additional .ini files in: (none) Additional .ini files parsed: (none)
And if I put php.ini in /usr/local/lib, the configuration file loads fine (although the additional .ini files don't load). I am not sure why this is happening since I set the options when I compiled PHP.
I did sudo aptitude --purge remove php5, which removed successfully, except php5 is still installed on my system. How can I uninstall and re-install php5?
UPDATE
Thanks for the answers, I have these packages installed:
tony@bandop $ aptitude search php|grep "^i"
i A libapache2-mod-php5 - server-side, HTML-embedded scripting langu
i php-pear - PEAR - PHP Extension and Application Repos
i php5-cli - command-line interpreter for the php5 scri
i A php5-common - Common files for packages built from the p
i php5-dev - Files for PHP5 module development
i php5-mysql - MySQL module for php5
I want to configure PHP to use a external PCRE library that I built. Do you know which package I have to reconfigure? Is there a way to specify config options when installing a package with aptitude?
UPDATE
I keep getting a warning when I use some php regex functions that says "this version of PCRE is not compiled with PCRE_UTF8 support." I have been digging pretty deep and think that all I need to do is install PCRE from source while the option --enable-utf8 when configuring PCRE. No problem. But then I need to tell PHP to find this new PCRE library. I think I have to install PHP from source and specify an external PCRE library as stated here: http://www.php.net/manual/en/pcre.installation.php
I think specifying the external PCRE library will involve just adding an option when when i do ./configure
If there is a way to do this while using aptitude? I need to set options when aptitude does the ./configure.
Thanks!
I just upgraded my Mac OS X to 10.5. Everything works great after a little Apache love, except for ruby and rails. This is what I am seeing
Macintosh:~ TAmoyal$ ruby test.rb
-bash: /usr/local/bin/ruby: cannot execute binary file
Macintosh:bin TAmoyal$ file ruby
ruby: Mach-O executable i386
Macintosh:~ TAmoyal$ ruby
-bash: /usr/local/bin/ruby: cannot execute binary file
Macintosh:~ TAmoyal$ rails
/usr/local/bin/rails: line 9: require: command not found
/usr/local/bin/rails: line 11: version: command not found
/usr/local/bin/rails: line 13: syntax error near unexpected token `('
/usr/local/bin/rails: line 13: `if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then'
However, the ruby in /usr/bin/ruby seems to work fine. That is not the one getting used.
I obviously have to get ruby working before rails works. I couldn't find much help googling the ruby issue. I am not really even sure what OS X is telling me.
Any suggestions?
Thanks!
I have a server with vhosts conf that looks like this:
NameVirtualHost *:80
# My Virtual Hosts:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName domain
DirectoryIndex index.php index.html
DocumentRoot /var/www/domain/public
# Custom log file locations
LogLevel warn
ErrorLog /var/www/domain/log/error_log
CustomLog /var/www/domain/log/access_log combined
<Directory "/var/www/dailysongfix/public">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
A typical vhost conf right? Well I also need to develop a few other sites on the server and these sites don't have domains hooked to them yet. How can I view them without a domain pointing at them? I am guessing maybe the IP address and a port, but not sure how to set that up.
I just made a website for someone who used to have a yahoo small business account so they could check "[email protected]" mail through their yahoo interface. Now they are not getting their email anymore probably because I changed the DNS records to point the domain to my server. How can I accept the email that he receives and forward to another email account? Is there anyway for me to not even receive the email and direct right to another email account he owns such as his aol account?
I have a rails app on an Ubuntu server. In my Apache config I have set the user and group to www-data. I want my rails app to write to a file. I have set the file permissions as follows:
-rw-rw-r-- 1 www-data www-data 0 Jun 5 22:35 notify_list.txt
Seems like rails should be able to write because the permissions are correct. But I keep getting permission denied. What are possible causes of this?
Thanks!
Here is the problem:
tony@bootsy/var/www/bandop $ ln -nfs /var/www/bandop/shared/config/database.yml /var/www/bandop/releases/20090601055013/config/database.yml
ln: creating symbolic link `/var/www/bandop/releases/20090601055013/config/database.yml': No such file or directory
I don't understand why '/var/www/bandop/releases/20090601055013/config/database.yml' has to exist. I want to create that sym link to hit the target specified above (first parameter). The command also failed to execute when logged in as root so it does not seem to be a permissions issue.
Any ideas?
Thanks
I have a virtual host set up on my Ubuntu server:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName dailysongfix.com
ServerAlias www.dailysongfix.com
DirectoryIndex index.php index.html
DocumentRoot /var/www/dailysongfix/public
# Custom log file locations
LogLevel warn
ErrorLog /var/log/apache2/dailysongfix/error_log
CustomLog /var/log/apache2/dailysongfix/access_log combined
</VirtualHost>
If I go to http : dailysongfix . com I get a forbidden error. This is probably an issue with my directory permissions...so I went over to /var/www
Here are my permissions:
ls -al /var
drwxr-xr-x 3 root root 4096 May 26 22:47 www
ls -al /var/www/
drwxr-xr-x 3 root root 4096 May 26 22:47 .
drwxr-xr-x 14 root root 4096 May 26 22:46 ..
drwxr-xr-x 3 root www-data 4096 May 26 22:53 dailysongfix
ls -al /var/www/dailysongfix/
drwxr-xr-x 3 root www-data 4096 May 26 22:53 .
drwxr-xr-x 3 root root 4096 May 26 22:47 ..
drwxr-sr-x 2 root www-data 4096 May 26 22:59 public
I also have this in my httpd.conf
User www-data
Group www-data
Does anyone know how to fix this?
Thanks!