running perl cgi script problec - macos

I am trying to run a simple hello world script as CGI (from the Beginning Perl book).
i am running to the following problems:
I do not find a folder /cgi-bin/ at any place on my computer (Mac OSX Lion).
I did try changing mode to 755 and any thing i found on the web.
when I try the localhost, I get "it works!" (this means the apache is working o.k)
I saw some advice on changing configurations on apache files and there are confusing
never the less i did try and all did not work.
for instance, the advice to check and uncheck the web button in sharing does no work in
mac osx lion, there isn't a button of that kind any more.
Is it possible to get a step by step guide or help on what to do from the Perl script to actually running it on the web server?

i do not find a folder /cgi-bin/ at any place on my computer (mac osx lion).
You can create one.
The Apache manual describes how to configure it for executing CGI.
when i try the localhost , i get "it works!" (this means the apache is working o.k)
You need to use the URI to the CGI script rather than the Apache root.
i sow some advice on changing configurations on apache files and there are confusing never the less i did try and all did not work. for instance, the advice to check and uncheck the web button in sharing does no work in mac osx lion, there isn't a button of that kind any more.
Apple did remove the GUI option. Instead of using it, fall back to the command line:
apachectl restart
It is usually a good idea to first check your config file edits with:
apachectl configtest

Related

Xampp shell refuses to respond to commands once server starts

I've been searching high and low for this one, figuring it to be a common noob problem, but nothing. I saw an oblique reference somewhere that xampp's shell won't accept ctrl-c to close an operation but I'd like to confirm.
As it is, I'm running Xampp on a win7 machine and it's set up with the default apache mysql combo. Which is all fine. Except that the command line stops receiving commands once I start a server. So if I want to run another command I've gotta exit the xampp command line and restart it.
Is there a way to abort shell scripts in the xampp shell or is it just a product of the environment it's running in?
Ok, I'm going to consider this solved.
While Xampp locks up once you start a server instance. It's possible to run a server directly through the windows normal command line Start->Run->cmd, while doing other xampp stuff in the xampp shell.

installing appflower on xampp for linux

I've been trying to figure out this problem for a while now and I thought I'd ask it here on stackexchange in case somebody out there has tried this and successfully got it to work.
I'm trying to install a RAD webapp tool called AppFlower through Xampp for Linux.
I am also experiencing issues with the command below:
symfony afs:init
symfony: command not found
This is the final command used to start up the AppFlower Studio dev environment, but this command doesn't work.
I have tried using:
./symfony afs:init
Same error as above
php ./symfony afs:init
gives a php error saying it isn't installed, but this is Xampp for Linux, so that command won't apply
/opt/lampp/etc/php.ini ./symfony afs:init
it will give a permission denied error, but even with 'sudo' in front, it says 'command not found'
The solution posted on the appflower forum is for xampp itself, but the problem I have is that they use the php.exe command to run the 'symfony afs:init' command, which xampp for linux doesn't have. The closest thing I could think of was to use the php.ini file, but (as seen above) that doesn't work.
Hopefully somebody can assist regarding this issue.
Regards,
Note. The process to run appflower on a manual version of lamp (one in which php, mysql, apache are all downloaded separately) is a lot more complex and the xampp installation is supposed to be much easier (in fact it is) but at the last point of this installation, this 'symfony afs:init' command is the only problem.
If you are already using Linux, why not install AppFlower directly. It's pretty straightforward, maybe i lost something on the way, understanding why you use XAMMP for Linux.
Installation instructions for AppFlower on Ubuntu,
http://www.appflower.com/doc/1_2/learn_install_git_on_ubuntu

MAMP Apache Won't Start after OS X 10.8 (Mountain Lion) update

Today I updated to OS X Mountain Lion. I noticed that Apache won't start in MAMP. Nothing new seems to be in the apache log file. Running sudo apachectl -k start in Terminal gives me this:
httpd: Could not reliably determine the server's fully qualified domain name, using Ryan-Smiths-MacBook.local for ServerName
I do have ServerName defined in my httpd.conf file.
I also noticed that "Web sharing" is no longer in the Settings pane... weird.
Any Ideas?
Thanks!
Hi Ryan we had this problem
It turns out the systems own apache is running. We've documented it here http://support.servertastic.com/mamp-not-starting-after-upgrade-to-mountain-lion/
Cheers
Richard
To fix the problem, and to start MAMP apache, you can now refer to: (the above link is broken now.)
https://support.servertastic.com/mamp-not-starting-after-upgrade-to-mountain-lion/
Or simply run the following command:
sudo apachectl stop
In addition if you run into trouble where your mysql no longer will start, try killing the mysql process that may already be running by doing the following:
Open up the program called "Activity Monitor" on your Mac.
Search for a process called “mysqld“.
Click on that process and “Quit Process”
Credits:
http://eliteeternity.com/mysql-server-wont-start-mamp-red-light-mac/
http://forum.mamp.info/viewtopic.php?f=6&t=6149
In MAMP PRO 2.1.1, click Tools > Quit Built-in Apache.
I was able to solve this running OS X 10.8.4 by opening up Activity Monitor, choosing "All Processes" then killing any with "httpd" in the title. After that I was able to start MAMP and both the MYSQL and Apache servers gave the green light!
this one fix my MAMP
Just navigate to /Applications/MAMP/bin/apache2/bin using Finder, and rename envvars to _envvars (yes, just add the underscore). Boom! Done and done.
from codesoap
Had the same problem; no other tricks helped. I found I had an instance with "allow from 127.0.0.1" – removing the IP did the trick. Don't know why.
http://cl.ly/image/253g1L1W472z
The problem with OSX Mountain Lion is that /usr/lib/libpq.5.3.dylib does not exist, but /usr/lib/libpq.5.dylib does.
To fix the issue, open terminal and:
~# sudo ln -s /usr/lib/libpq.5.3.dylib /usr/lib/libpq.5.dylib
just try to modify mamp in httpd.conf with:
LoadModule php5_module /Applications/MAMP/bin/php/php5.5.3/modules/libphp5.so
My solution to the similar problem. I.e. MySQL was running fine from MAMP manager utility. Apache server did not and the "Open start page" was greyed i.e. not working.
It seems that my problem was, that the Apache server was not for one reason or another able to access it's log file apache_error.log in /Applications/MAMP/logs folder. The file seemed to be somehow "stuck" i.e. I was not able to change the access rights to the file with chmod command. Only after I deleted the log file completely and then restarted the MAMP control utility and started there the MySQL and Apache again, everything worked fine.
BR,
Janne
Had the same problem.
I then set the ServerName to localhost and the Listen port to 8080, because 80 was somehow not available (even not as sudo). In my case it seems to have fixed the problem.
If nothing works for you like me, the problem is likely that you ran your MAMP update with MAMP running, then you closed the existing MAMP without stopping your server. All you need to do is restart your machine.

Apache on mac OS X snow leopard doesn't seem to run

I have mac OS X and would like the built-in apache webserver to run. So I open up "System Preferences", click on "Sharing" and enable "Web sharing". Web server starts (apparently) and the system displays two links which I can use. One is just my ip and the other is my ip/username. Both links just result in "no connection" error in the browser. It doesn't appear to reach apache at all, like apache isn't running.
So I open up terminal and enter:
ps aux | grep apache
no apache process found. I then try the following command:
netstat -ln | grep ':80 ' | grep 'LISTEN'
and nothing is returned. So it appears apache isn't running.
Why would the system preference tell me otherwise? And how can I fix it?
I would use Terminal (/Applications/Utilities), and then try to start apache from the command line.
Try this to help debug:
sudo bash -x /usr/sbin/apachectl -k start
when it is dying silently. Also, check the error_log at:
/var/log/apache2/error_log
You can use TextEdit for the error_log, if you feel more comfortable with a GUI text editor.
Let me know how it goes!
Have had similar problem on a (by now rather old) Macbook still running SL.
Looking at the log, per previous answer, revealed an error loading mod_hfs_apple.so from /usr/libexec/apache2. Checking this, there was no such file in that folder. I copied the file from my other Mac (running Lion, not Snow Leopard) and hey presto the sudo restart command got the server going.

OSX Equivalent of WinSCP's Fully-Automated Local-Remote SFTP Sync?

I fondly remember working with WinSCP and using the fully automated local-to-remote syncing functionality, where the app would monitor a directory hierarchy and send changes to the remote server as they happened.
Is there an app available on OSX that accomplishes the same thing? I haven't really been able to find anything. When I do find something promising, it always turns out to be a traditional syncing app, where you need to initiate the sync command manually and it then scans the hierarchy to find changed files. That takes too long and isn't automated.
Been looking at the File System Events API, wondering if a small app could be pieced together with a small utility to trigger hierarchy changes and feed the changed directory to rsync or something.
Thanks for any leads!
There are two Mac-specific utilities you may be able to utilize to make your job easier:
Automator (link and link)
Folder Actions (link link and link)
Both tools have AppleScript as a common thread (which can be used to execute shell commands). You might be able to write a small AppleScript that is launched when a folder changes to call rsync and perform the service you require.
Well, I had the same kind of problem and it is possible using these together: rsync, SSH Passwordless Login, Watchdog (a Python sync utility) and Terminal Notifier (an OS X notification utility made with Ruby. Not needed, but helps to know when the sync has finished).
I created the key to Passwordless Login using this tutorial from Dreamhost wiki: http://cl.ly/MIw5
1.1. When you finish, test if everything is ok… if you can't Passwordless Login, maybe you have to try afp mount. Dreamhost (where my site is) does not allow afp mount, but allows Passwordless Login. In terminal, type:
ssh username#host.com
You should login without passwords being asked :P
I installed the Terminal Notifier from the Github page: http://cl.ly/MJ5x
2.1. I used the Gem installer command. In Terminal, type:
gem install terminal-notifier
2.3. Test if the notification works.In Terminal, type:
terminal-notifier -message "Starting sync"
Create a sh script to test the rsync + notification. Save it anywhere you like, with the name you like. In this example, I'll call it ~/Scripts/sync.sh I used the ".sh extension, but I don't know if its needed.
#!/bin/bash
terminal-notifier -message "Starting sync"
rsync -azP ~/Sites/folder/ user#host.com:site_folder/
terminal-notifier -message "Sync has finished"
3.1. Remember to give execution permission to this sh script. In Terminal, type:
sudo chmod 777 ~/Scripts/sync.sh
3.2. Run the script and verify if the messages are displayed correctly and the rsync actually sync your local folder with the remote folder.
Finally, I downloaded and installed Watchdog from the Github page: http://cl.ly/MJfb
4.1. First, I installed the libyaml dependency using Brew (there are lot's of help how to install Brew - like an "aptitude" for OS X). In Terminal, type:
brew install libyaml
4.2. Then, I used the "easy_install command". Go the folder of Watchdog, and type in Terminal:
easy_install watchdog
Now, everything is installed! Go the folder you want to be synced, change this code to your needs, and type in Terminal:
watchmedo shell-command
--patterns="*.php;*.txt;*.js;*.css" \
--recursive \
--command='~/Scripts/Sync.sh' \
.
It has to be EXACTLY this way, with the slashes and line breaks, so you'll have to copy these lines to a text editor, change the script, paste in terminal and press return.
I tried without the line breaks, and it doesn't work!
In my Mac, I always get an error, but it doesn't seem to affect anything:
/Library/Python/2.7/site-packages/argh-0.22.0-py2.7.egg/argh/completion.py:84: UserWarning: Bash completion not available. Install argcomplete.
Now, made some changes in a file inside the folder, and watch the magic!
I believe transmit does this.

Resources