apache2 -v
vendredi 15 août 2014
jeudi 20 septembre 2012
Problem: Server Ode v1.x Server at localhost failed to start.
java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:55)
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
Analyse: miss the tomcat-juli.jar in the Classpath
check by: echo $CLASS_PATH
if the reply is empty, that is.
so you can add the tomcat-juli.jar into the classpath.
Solution:
1. double-click on the ODE server entry in the Servers view; this should open the server configuration editor
2. in the configuration editor, click the "Open launch configuration" link
3. select "Classpath" in the launch configuration dialog and then "Add externals jars..."
4. navigate to your $CATALINA_HOME/bin and select the tomcat-juli.jar
Hope that helps
Bob
this solution comes from the eclipse forum:
http://www.eclipse.org/forums/index.php/m/760341/
-
mardi 26 juillet 2011
Restart Apache in Mac OS X
sudo /usr/sbin/apachectl restartif you have the following error: /usr/sbin/apachectl: line 73: ulimit: open files: cannot modify limit: Invalid argument
follow the instructions:
to
ULIMIT_MAX_FILES=""
ref: http://www.justinball.com/2010/11/23/apachectl-stopped-working-after-mac-osx-10-6-5/
jeudi 11 mars 2010
【转】Mac OS X 下Apache2.2、MySQL 5.1和PHP 5.3的安装与配置
Mac OS X基于强大的UNIX底层技术创建,具有极高的安全性和网络服务能力,很多朋友都希望在自己的Mac上搭建一个Web Server,虽然目前已经有MAMP、XAMPP等简单易用的傻瓜式打包程序,但是如果我们要修改详细的配置文件来搭建最适合我们自己的Web服务器, 恐怕还是得自己动手,手动安装了,这也符合咋DIY得精神要领嘛。废话不多,教程开始!
1.安装环境
操作系统:Mac OS X Leoaprd 10.5.6 (Snow Leoapd相同)
数据库:MySQL 5.1.41
Web服务器:Apache 2.2.14
脚本语言:PHP 5.3.0
2.安装MySQL 5.1.41
下载MySQL,在www.mysql.com上有提供下载,直接下载对应你系统环境的DMG包就好了,方便,省的编译。
挂载DMG镜像,安装两个pkg程序包进行安装,最后安装MySQL.prefPane偏好设置面板。
然后开启终端,首先确定你计算机启用了root帐户,进行如下操作:
$ sudo /usr/local/mysql/bin/mysqld_safe –user=root & //启动MySQL(也可以通过偏好设置面板来启动)
$ sudo /usr/local/mysql/bin/mysqladmin -uroot password yourpassword //设置MySQL密码(注意,这是第一次MySQL密码为空的时候的设置命令,如果是修改密码,还需在-uroot 后面加上-pyourpassword 来进行权限确认.yourpassword是你的密码)
$ sudo /usr/local/mysql/bin/mysqladmin -uroot -pyourpassword shutdown //停止MySQL(也可以通过偏好设置面板来停止)
3.安装Apache 2.2.14 (Mac OS X 已经自带了Apache了,这里写出来是为了方便大家安装到最新版或者日后升级Apache参考,嫌麻烦的直接跳过此步)
系统自带Apache路径为/etc/apache2/
要启动系统自带Apache,只要在System Preferences -> Sharing 选择Web Sharing即可开启内置的Apache.
配置文件位置是:
/etc/apache2/httpd.conf
httpd的文档更目录是: /Library/WebServer/Documents/
user_dir模块默认自动开启,访问地址是: http://localhost/~username
user_dir的目录路径是: ~/Sites
restart Apache命令是: sudo apachectl graceful
如果要自己安装Apache,可以参考此文
首先,到www.apache.org下载最新的没编译过的UNIX源码,然后就是解压,输入命令编译,命令如下
$ sudo ./configure –prefix=/etc/apache2 \
> –enable-module-most \
> –enable-shared=max
可能这时候很多人就要出问题了,编译不成功,因为编译是需要编译器的,因为这些代码都是用C或C++写成的,所以最常用的就是GCC,但是单独下载GCC 是不行的,后面编译的时候机子会找不到编译器的,所以必须安装Apple自己提供的强大,多功能的(Apple自己说的)IDE—-XCode。可以到 Apple的官方网站下载(首先需要注册ADC的账号,免费)然后就可以下载,安装,再编译,成功!
然后安装:
$ make
$ make install
安装成功后配置Apache,配置文件为/etc/apache2/httpd.conf,关于Apache,我会另外花时间专门写一篇Apache的配置教程。
4.安装PHP 5.3.0
安装PHP,可以自己编译,也可以下载现成的打包程序,自己编译的话,去php.net下载源码,解压编译安装即可,命令如下
$ sudo ./configure –prefix=/usr/local/php5
$ make
$ make install
如果嫌麻烦,就直接下载编译好的打包程序,点此进入官方下载页面
下载后,运行程序包安装!
测试PHP安装
首先,重启Apache服务器
然后建立一个纯文本文件,内容为
然后保存文件名为test.php到/User/youruersname/Sites下(yourusername为你的登陆用户名)
然后打开浏览器,键入地址:http://localhost/~yourusername/test.php,然后看显示结果,如果已经显示出PHO信息,则说明你的Apache+PHP已经正确安装,但是,还需要调试,否这PHP无法正常运行,
先下载此文件,(PHP探针,可以测试很多PHP和数据库相关的东西)然后解压到/User/youruersname/Sites下
然后在浏览器键入http://localhost/~yourusername/iprober,看显示结果,此时应该是空白的,什么都显示不出来,此时,需要修改php.ini配置文件
在Finder中按快捷键Shift+苹果+G,输入路径/usr/local/php5/bin,然后找到php.ini,复制到桌面上,然后用文本编辑打开,找到
display-errors = Off
把Off改成On,打开错误提示,保存,然后复制回/usr/local/php5/bin,需要键入密码,重启Apache服务,然后继续访问 http://localhost/~yourusername/iprober,此刻,PHP错误显示错来了,根据错误,我们再来配置php.ini, 找到
short_open_tag = Off
把Off改成on,打开,因为只有把short_open_tag设置为On,
安装配置篇,目前就暂时写到这里了,后面我会写一个系列的文章,教大家在自己的Mac上安装PHP网站,设计制作自己的网站,动态域名链接以及用Mac OS X搭建虚拟主机存放多个网站等等!谢谢大家的关注,有什么问题,留言给我,我非常希望和大家探讨,共同学习!
原文地址:http://blog.hellomac.com.cn/?p=44
mardi 10 novembre 2009
Enable Apache installed in Mac OS X
If you’re running Mac OS X it has some surprises for you. Seems, PHP and the Apache Web
Generally on a Mac there are Icons that represent programs and documents that you double-click to execute their existence. With PHP and Apache, they run in the background with no sign of an Icon in sight.
To start Apache Web Server, you must go into the “System Preferences Control panel located on the “Apple Menu”.
Click on the Icon labeled "Sharing". Then locate the tab labeled "File & Web". You will want to click the button labeled “Start” in the "Web Sharing " section. This starts up Web sharing which starts the Apache Web Server.
Apache Web Server is now running. Easy, huh? "How can I tell?” you ask. Simple. Start up your web browser of choice. In the web address or URL part of your browser, type: "localhost" (without the double-quotes)
Ex. http://localhost
If everything is Okay, your browser will display the following:
"If you can see this, it means that the installation of the Apache Web server software on this system was successful. You may now add content to this directory and replace this page."
It worked! Hooray.
To access the pages of this directory, double-click on your hard drive and locate the "Library" directory. From there locate the "WebServer" directory and then the "Documents" directory where these web pages reside.
Note: If its not running, you either do not have web sharing enabled or something is wrong with Apache's files. It should work right out of the box.
Since Mac OS X is a multi-user system, every person has their own account and with that brings it’s own set of web pages. To access your personal web pages you must type the following in the browser address:
Ex. http://localhost/~yourname/
To access your personal web pages, locate your account name directory under "Users" And locate the directory labeled "Sites".
/Users/yourname/Sites/your web pages are here <---
Now that you have Apache running, it would be great to write your own PHP scripts and run them locally on your Mac. This is the most difficult part and if you get past this, everything is downhill with ease.
lundi 9 novembre 2009
Change default document root for Apache 2 in Ubuntu
If you want to change this default directory, modify the file "/etc/apache2/sites-available/default" (sudo gedit /etc/apache2/sites-available/default), and then, use the following two commands:
sudo apache2ctl -t
And then
sud apache2ctl restart
ps: sometimes you need to restart your apache server, here is the commands:
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 restart