2009년 11월 1일 일요일

황당한 화면먹통 해결하면서,,

어떤사이트에 검색중에, 화면해상도를 넓게 사용하는 서버라서 그랬는지,

난 1024*768을 사용하는데, 화면이 좀 부족해서, 넓히려고,

화면해상도를 만지다, 1280*768로 바꾸고는 화면먹통,,,

마소윈도우에서는 이런 실수가 났을경우에, 자동복구를 해주는데,

리눅스는 그런 해결책을 안주고, 사용자에게 모든것을 맡기는 것이

떼로는 좋기도하나, 이땐, 정말, 그동안 작업해논 화일들을

잘못하면 날릴수도 있는 상태..

물론 루트로 들어가서 살릴수도 있으나, 그런방법말고,

정공법을 택했는데, 아무리봐도 각각의 사용자의 해상도를 직접

조절하는화일은 안보이고,,

그러다, 겨우 찾았습니다.

얼마나 깊이 들어있는지, 거기다 숨김속성까지 갖추고,,,

그화일의 위치입니다.

센토스를 기준으로,,

/home/사용자/.gconf/desktop/gnome/screen/default/0/%gconf.xml

이걸 vi로 들어가서, 밑에처럼 수정하니, 화면이 나오더군요, 휴~우,,






1024x768





2009년 10월 28일 수요일

CentOS에서 동영상보기



CentOS를 설치하고, 여러가지를 배우다보니,

동영상플레이어를 만질기회가 없다가,

동영상 하나 볼일이 있어서, 프로그램에 설치돼돼있는 토템플레이어로

열어보니, 실행이 안됐습니다.

그래서, 검색해보니, 볼수있는방법이 있더군요,

그걸 소개 합니다.

순서는 코덱을 먼저 설치하고, mplayer를 설치하고,

아마도 mplayer의 제어화면역할을 하는지, smplayer을

설치하는것까지 입니다. 그러고나면, 안되던 토템플레이어도

실행이 됩니다.

밑에 써있는 내용을 모두 한줄한줄 실행시키는 겁니다.


yum -y install yum-priorities

rpm -Uvh http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

yum -y install gstreamer

yum -y install gstreamer-tools

yum -y install gstreamer-plugins-base

yum -y install gstreamer-plugins-good

yum -y install gstreamer-plugins-bad

yum -y install gstreamer-plugins-ugly

yum -y install mplayer

yum -y install smplayer

이상입니다.

레드햇계열에는 다 통용될듯싶습니다.


2009년 10월 26일 월요일

CentOS54 php5.3

http://www.webtatic.com/blog/2009/06/php-530-on-centos-5/

PHP 5.3 on CentOS 5
Posted 20th June 2009 by Andrew Thompson | 63 Comments

My previous articles on installing PHP on CentOS dealt with installing PHP 5.2.6. I have found this to have some bugs that kill the process without error information. One bug I found, which was on an x86_64 server, was that converting an object to a string did this.

So, I have compiled the latest PHP version, 5.2.10 5.3.0, and put it in my own repository for easy installation. I have compiled it for CentOS 5 i386 and x86_64, and provided the source RPMS in the repo, if anyone wants to compile it for another OS or architecture.

Update 2009-07-03 – I updated the version to PHP 5.3, which was released a few days before. This includes many new features such as closures, namespaces, and packaged scripts in phar files, which I’ll blog about soon. Check out PHP changelog for more details.
Update 2009-09-01 – Added a note about deprecated errors, and how to silence them. Also I have included a tip that might help those of you struggling to install.

I have also included the same php extensions I mentioned in my other article, php-mcrypt, php-mhash, php-mssql and php-tidy

To install, first you must tell rpm to accept rpm’s signed by me:

rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy

Then add the yum repository information to yum:

cd /etc/yum.repos.d/
wget http://repo.webtatic.com/yum/webtatic.repo

Now you can install php by doing:

yum --enablerepo=webtatic install php

Or update an existing installation of php, which will also update all of the other php modules installed:

yum --enablerepo=webtatic update php

If this does not work correctly, try disabling all other repositories while installing/updating, by adding the –disablerepo=* option. This will stop other dependencies from being installed, so you may want to install them first.

yum --disablerepo=* --enablerepo=webtatic update php

Deprecated Errors

Once you are running the new version, you may get “deprecated” errors in your error logs. This isn’t bad, it just means to tell you that some of the functions you are using are no longer prefered, and may be removed in a future major release. An example of this is the ereg functions. Preg functions are prefered over these, as they are much faster and more powerful, and in all cases do at least the same thing.

If upgrading the functions are not an option, and you would like to hide the deprecated errors from your error log, for example on a production server, just edit your /etc/php.ini file, find the line:

error_reporting = E_ALL

and replace to:

error_reporting = E_ALL & ~E_DEPRECATED

PHP 5.2.10

I am also maintaining a PHP 5.2.10 release, so should you prefer to install that (for reasons like incompatibilities or testing), you can force it to install that instead by doing:

yum --enablerepo=webtatic --exclude=php*5.3* update php

Or you can add to the /etc/yum.repos.d/webtatic.repo the line:

exclude=php*5.3*

Related Posts

* Installing PHP 5.2.6 on CentOS 5 – extra extensions
* Installing PHP 5.2.6 on CentOS 5
* Git 1.6.4 on CentOS 5
* Get an “A” in YSlow with Webtatic Optimizer
* PHP public key cryptography using OpenSSL
* Generating a random PHP identifier

This entry was posted on at 10:13 am and is filed under Server Admin, Software using CentOS, PHP as tag(s). You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
« mod_auth_mysql digest authentication patch
PHP public key cryptography using OpenSSL »
63 Responses to “PHP 5.3 on CentOS 5”

1.
Matt says:
21st June 2009 at 3:32 pm

Thanks for this!
Reply
2.
Andy says:
23rd June 2009 at 12:04 pm

Noticed Fedora 11 has a version of php 5.2.9, so I built a new version based on that (a few modifications were needed for CentOS), and put it in the repo.

This version has the additional patches that Fedora added, and comes in a single source RPM. There are a few additonal RPMs as well, such as a ZTS (Zend Thread Safety) compilation which will work better on Httpd Worker mpm.
Reply
3.
iNoize says:
25th June 2009 at 1:48 pm

Hmm got some Trouble
php-gd-5.2.10-4.x86_64 from webtatic has depsolving problems
–> Missing Dependency: libt1.so.5()(64bit) is needed by package php-gd-5.2.10-4.x86_64 (webtatic)
Error: Missing Dependency: libt1.so.5()(64bit) is needed by package php-gd-5.2.10-4.x86_64 (webtatic)
Reply
4.
Aurelian says:
30th June 2009 at 2:16 pm

–> Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.10-4.i386 (webtatic)
Error: Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.10-4.i386 (webtatic)

Why do i get this error?! I have installed CENTOS using

http://www.howtoforge.com/perfect-server-centos-5.3-i386-ispconfig-2

As tutorial. I’m complete newbie in LINUX. Please guide me through this.
Reply
5.
Andy says:
30th June 2009 at 10:42 pm

Sorry, it appears to be a rpm dependency that was missing in Fedora’s spec file I used. I’ve compiled new i386 and x64 binaries that have the correct dependencies, so you should just be able to attempt again and it’ll work.

I’ll try mentioning it to them, as it must be an issue on Fedora as well. The base install may include the package or something though.
Reply
6.
Joseph says:
3rd July 2009 at 9:14 am

First off, thanks for providing these packages! I’ve just installed PHP 5.3.0 on CentOS 5.3 and it is working great!

However, when trying to install php-gd I get an error similar to what Aurelian is reporting above:

php-gd-5.3.0-1.i386 from webtatic has depsolving problems
–> Missing Dependency: libt1.so.5 is needed by package php-gd-5.3.0-1.i386 (webtatic)
php-gd-5.3.0-1.i386 from webtatic has depsolving problems
–> Missing Dependency: t1lib is needed by package php-gd-5.3.0-1.i386 (webtatic)
Error: Missing Dependency: libt1.so.5 is needed by package php-gd-5.3.0-1.i386 (webtatic)
Error: Missing Dependency: t1lib is needed by package php-gd-5.3.0-1.i386 (webtatic)

Any ideas?
Reply
7.
Andy says:
3rd July 2009 at 12:07 pm

right, figured out the problem, t1lib was part of rpmforge’s repository (I always set that one up as it has a few extra packages I use)

I’ve removed the t1lib dependency and recompiled a new version of 5.3.0, so you can install/update to that and it should work fine.
Reply
*
Joseph says:
3rd July 2009 at 4:21 pm

Awesome! Works now. Thanks so much for your work.
8.
Hamid says:
25th July 2009 at 6:23 pm

Andy, thanks for providing help and yum sources. However, after doing “yum –enablerepo=webtatic update php”, I get:

–> Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 (installed)
Error: Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 (installed)

I am doing this on CentOS 5.2 64-bit for PHP 5.3 although I would be happy with PHP 5.2.10. Is your solution expected to work for me?
Reply
*
Andy says:
25th July 2009 at 6:27 pm

Hi Hamid,

PHP 5.3 actually contains the fileinfo extension as part of its default extensions.

You can remove the pecl extension and the rpms will install the fileinfo extension as part of the base php-common package.
*
Hamid says:
25th July 2009 at 8:53 pm

Hi Andy. Thanks for the guidance. I did:

yum remove php-pecl-Fileinfo.x86_64

ran PHP 5.3’s ./configure, make, make test & make install. php -v gives tons of errors relating to shared extensions written to /usr/lib/20090626 instead of the 64-bit one defined in /usr/lib64/php/modules.

Is there any hope in building PHP 5.3.0 on Centos 5.2-64?
*
Andy says:
25th July 2009 at 8:58 pm

sorry I don’t understand why you are building PHP 5.3? The repo contains that version, so you don’t need to compile.
9.
Hamid says:
26th July 2009 at 2:00 am

Andy, I have tried yum upgrade php.x86_64 & yum update php.x86_64 to no avail. Also, I tried yum upgrade of most other php packages installed:
php.x86_64
php-cli.x86_64
php-common.x86_64
php-dba.x86_64
php-devel.x86_64
php-gd.x86_64
php-imap.x86_64
php-ldap.x86_64
php-mbstring.x86_64
php-mysql.x86_64
php-odbc.x86_64
php-pdo.x86_64
php-pear.noarch
php-pear-DB.noarch
php-pear-Date.noarch
php-pecl-Fileinfo.x86_64
php-tidy.x86_64
php-xml.x86_64

which result in “No Packages marked for Update”.

I have your repo in my repo list. Can you point me in the right direction?

Many thanks, Andy.
Reply
10.
Andy says:
26th July 2009 at 9:31 am

hmm, my .repo file seems to act funny with the source repo definition in. I’ve deleted that part, so if you re-download it, yum should work better.

all you should have to do is:
yum –enablerepo=webtatic update php
Reply
11.
Hamid says:
26th July 2009 at 5:57 pm

Andy, now it’s at least trying:

#yum –enablerepo=webtatic update php

–> Processing Dependency: php-api = 20041225 for package: php-pecl-Fileinfo
–> Processing Dependency: php-api = 20041225 for package: php-pecl-memcache
–> Finished Dependency Resolution
php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 from installed has depsolving problems
–> Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 (installed)
php-pecl-memcache-2.2.3-1.el5_2.x86_64 from installed has depsolving problems
–> Missing Dependency: php-api = 20041225 is needed by package php-pecl-memcache-2.2.3-1.el5_2.x86_64 (installed)
Error: Missing Dependency: php-api = 20041225 is needed by package php-pecl-memcache-2.2.3-1.el5_2.x86_64 (installed)
Error: Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 (installed)

except that I already have php-pecl-memcache installed:

# yum install php-pecl-memcache.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: http://www.cyberuse.com
* updates: mirror.anl.gov
* addons: mirror.raystedman.net
* extras: http://www.cyberuse.com
Setting up Install Process
Parsing package install arguments
Package php-pecl-memcache-2.2.3-1.el5_2.x86_64 already installed and latest version
Nothing to do

I don’t even see your repo in the list.
Reply
*
Andy says:
26th July 2009 at 11:02 pm

Sorry Hamid, I haven’t built any of CentOS’s php-pecl-* packages with PHP 5.3.

It probably would be a good idea to, so I’ll try and sort that out soon, but in the meantime the only alternative is to uninstall all of them and “pecl install memcache” yourself. Fileinfo is already contained in the php packages, so you wont need to manually compile that.
*
Hamid says:
26th July 2009 at 11:31 pm

Thank you kindly Andy.
12.
Chip says:
29th July 2009 at 2:58 am

Thanks a ton, Andy! This was a huge help.
Reply
13.
Klaus says:
29th July 2009 at 10:13 pm

Great work! Thanks for the great packages, Andy. Really appreciated.

Any chance you can provide a package with curl? Thanks! :)
Reply
14.
TonyG says:
30th July 2009 at 4:23 am

My current php version is “5.1.6-20.el5_2.1″. I followed the instructions and got the following error, what can I do to resolve?:

….
—> Package php-ncurses.i386 0:5.2.10-5 set to be updated
–> Processing Dependency: php-common = 5.2.10-5 for package: php-ncurses
—> Package php-snmp.i386 0:5.3.0-3 set to be updated
—> Package php-pdo.i386 0:5.3.0-3 set to be updated
—> Package php-mysql.i386 0:5.3.0-3 set to be updated
—> Package php-imap.i386 0:5.3.0-3 set to be updated
—> Package php-xml.i386 0:5.3.0-3 set to be updated
–> Finished Dependency Resolution
Error: Missing Dependency: php-common = 5.2.10-5 is needed by package php-ncurses
Reply
15.
Andy says:
30th July 2009 at 7:50 am

@Klaus – php-curl is provided by the php-common package which should already be installed as it is a dependency of the php package, if that’s what you mean?

@TonyG – php-ncurses was removed from php’s distribution in 5.3, however you could “yum remove php-ncurses”, and “pecl install ncurses” when you’ve upgraded php, as it should be in pecl’s repository.
Reply
16.
brian says:
31st July 2009 at 5:34 pm

I have been able to install the 5.2.10 packages from your repo, which is great, but I am also trying to use your mhash and mcrypt packages. They seem to have installed correctly, however they do not show up in phpinfo() when run through apache. They DO show up if phpinfo() is run from the command line “php” command. Any ideas?

I’m using CentOS 5.3 32-bit.
Reply
*
Andy says:
31st July 2009 at 6:32 pm

The only situation I’d expect that to occur would be if you haven’t reloaded apache, sorry if you have already.
17.
brian says:
31st July 2009 at 8:07 pm

I have reloaded apache and found these messages in the error log:
PHP Warning: PHP Startup: mcrypt: Unable to initialize module\nModule compiled with module API=20060613, debug=0, thread-safety=0\nPHP compiled with module API=20060613, debug=0, thread-safety=1\nThese options need to match\n in Unknown on line 0
PHP Warning: PHP Startup: mhash: Unable to initialize module\nModule compiled with module API=20060613, debug=0, thread-safety=0\nPHP compiled with module API=20060613, debug=0, thread-safety=1\nThese options need to match\n in Unknown on line 0

This is my apache version: httpd-2.2.3-22.el5.centos.1
Reply
18.
Michael Mansour says:
2nd August 2009 at 5:20 pm

Hi Andy. I’ve just used your 5.2.10 RPM’s on Scientific Linux 5.3 (RHEL 5 derivative like CentOS).

They installed fine.

I used to use the Jason Litka’s (utterramblings) RPM’s for php 5.2.6 but he hasn’t updated in a long time. I have also tried remi which wouldn’t install without upgrading MySQL 5.0.45 to 5.1.x.

I’m glad your php 5.2.10 installs without the problems above.

However, one really good php module supplied by utterramblings is the php-xcache module, which is the php accelerator, one of the fastest open source ones around.

Could you compile this into your repo please?

I found a src rpm here:

http://yum.aclub.net/pub/linux/centos/5/umask/SRPMS/

I’m also wondering how with yum, you can tell it not to list the php 5.3.0 RPM’s on a yum list (or yum check-update) and concentrate only on the 5.2.x series?

Lastly, I wouldn’t mind emailing you directly outside of these comments sections but I couldn’t find an email address for you.

Could you email me please as I have some questions which aren’t really suitable for these comments.

Thanks for providing all this btw, you’re a life saver.
Reply
*
Andy says:
2nd August 2009 at 10:56 pm

Updated the article to show how to install just the PHP 5.2.10 version.

@Michael Thanks, I’ve sent you an email.
19.
Toby says:
3rd August 2009 at 3:07 pm

Hi there,

Great article, thanks for posting this. Would I be able to use your repository to add php-devel to my PHP 5.2.9 installation?

Cheers,

Toby
Reply
*
Andy says:
3rd August 2009 at 6:27 pm

Hi Toby,

I’d recommend upgrading to php 5.2.10, which is in this repository, including its php-devel package, as it is only a bugfix release, and shouldn’t have incompatibilities with my previous php 5.2.9 release.

I’d rather not maintain multiple bugfix releases, as there is a lot of overhead in having to recompile them with additional patches.
*
Toby says:
3rd August 2009 at 8:45 pm

Ok Andy, thanks for the tip, I’ll give it a try!

Best wishes,

Toby
20.
Toby says:
4th August 2009 at 1:51 pm

Hi Andy,

Sorry to bother you again. Trying to upgrade to 5.2.10 as suggested gives me a similar missing dependency to that mentioned by Joseph above:

php-gd-5.2.10-5.i386 from webtatic has depsolving problems
–> Missing Dependency: t1lib is needed by package php-gd-5.2.10-5.i386 (webtatic)
php-gd-5.2.10-5.i386 from webtatic has depsolving problems
–> Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.10-5.i386 (webtatic)
Error: Missing Dependency: t1lib is needed by package php-gd-5.2.10-5.i386 (webtatic)
Error: Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.10-5.i386 (webtatic)

Is there anything I can do to work around this? And presumably if I can get this to work I then just do an install of php-devel from your repository?

Thanks again,

Toby
Reply
*
Andrew Thompson says:
4th August 2009 at 3:10 pm

Hi Toby,

Sorry, I had only removed the t1lib dependency from the 5.3 version. I’ve compiled a new php 5.2.10 one now which you can use.
21.
Toby says:
4th August 2009 at 5:19 pm

Hi Andy,

I’m really sorry to keep bugging you, it seems unfair given all your good work! Having upgraded to 5.2.6 it ’seems’ to have toasted my install. My Apache error_log now shows this on restart:

PHP Warning: PHP Startup: bcmath: Unable to initialize module\nModule compiled with module API=20060613, debug=0, thread-safety=0\nPHP compiled with module API=20060613, debug=0, thread-safety=1\nTh$
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/curl.so’ – /usr/lib/php/modules/curl.so: undefined symbol: file_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/dbase.so’ – /usr/lib/php/modules/dbase.so: undefined symbol: core_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/gd.so’ – /usr/lib/php/modules/gd.so: undefined symbol: core_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/json.so’ – /usr/lib/php/modules/json.so: undefined symbol: executor_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mbstring.so’ – /usr/lib/php/modules/mbstring.so: undefined symbol: sapi_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mysql.so’ – /usr/lib/php/modules/mysql.so: undefined symbol: executor_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mysqli.so’ – /usr/lib/php/modules/mysqli.so: undefined symbol: executor_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/pdo.so’ – /usr/lib/php/modules/pdo.so: undefined symbol: executor_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/pdo_mysql.so’ – /usr/lib/php/modules/pdo_mysql.so: undefined symbol: php_pdo_register_driver in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/pdo_sqlite.so’ – /usr/lib/php/modules/pdo_sqlite.so: undefined symbol: executor_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/zip.so’ – /usr/lib/php/modules/zip.so: undefined symbol: executor_globals in Unknown on line 0

and phpinfo() is missing a bunch of sections (including mysql, bcmath etc).

Any idea what’s happened? Should I/can I roll back to the previous version?

Sorry to pester you with so many questions, I’m far from the Linux ninja I should be.

Toby
Reply
*
Toby says:
4th August 2009 at 6:36 pm

PS Actually, I should probably mention that after the PHP upgrade I installed php-devel from your repository followed by httpd-devel and apc, although apc has now been removed.
*
Toby says:
4th August 2009 at 6:46 pm

PPS Final two installs were from centos repository
*
Andrew Thompson says:
4th August 2009 at 6:52 pm

Hi Toby, I’ve sent you an email, so you can reply to me from the email if you’d like.
22.
Tom says:
4th August 2009 at 8:10 pm

Thank you for providing these packages!!

I am trying to use this to install lilac and it’s saying “PHP’s POSIX support is not available. POSIX support is required for the importer/exporter/autodiscovery to function”

Was this compiled with “–disable-posix” or is there something else wrong?
Reply
*
Andrew Thompson says:
4th August 2009 at 8:20 pm

At some point fedora split off the posix and other process extensions from the base install, you can install it doing “yum install php-process”
*
Tom says:
5th August 2009 at 12:50 am

Andrew,

Thank you so much. That was what I needed.

Tom
*
Lawal Adekunle says:
5th August 2009 at 4:59 pm

@ Andrew Thompson. Thanks so much for your post. You saved ma a whole lot of headache. i was installing centreon and it kept giving me Critical: php-posix functions are not installed. Now its Solved thanks a lot
23.
Matt Farmer says:
5th August 2009 at 9:02 am

Hey Andy,

Thanks for putting this all together. I’m also running into dependency issues with php-common.

# yum –enablerepo=webtatic update php

–> Finished Dependency Resolution
php-ncurses-5.2.10-6.i386 from webtatic has depsolving problems
–> Missing Dependency: php-common = 5.2.10-6 is needed by package php-ncurses-5.2.10-6.i386 (webtatic)
sb-publish-3.0.1-200705230939.noarch from installed has depsolving problems
–> Missing Dependency: any-php-sqlite2 is needed by package sb-publish-3.0.1-200705230939.noarch (installed)
php-mhash-5.2.10-6.i386 from webtatic has depsolving problems
–> Missing Dependency: php-common = 5.2.10-6 is needed by package php-mhash-5.2.10-6.i386 (webtatic)
Error: Missing Dependency: php-common = 5.2.10-6 is needed by package php-mhash-5.2.10-6.i386 (webtatic)
Error: Missing Dependency: any-php-sqlite2 is needed by package sb-publish-3.0.1-200705230939.noarch (installed)
Error: Missing Dependency: php-common = 5.2.10-6 is needed by package php-ncurses-5.2.10-6.i386 (webtatic)
Reply
*
Andrew Thompson says:
5th August 2009 at 9:53 am

Hi Matt,

Try “yum update –enablerepo=webtatic php*”. Possibly it’s trying to satisfy dependencies without upgrading them.

Also your output says something about “sb-publish”, which doesn’t look like it works with it.
24.
Matt Farmer says:
5th August 2009 at 5:05 pm

Thanks for your reply Andy,

That command gives a very similar reply. Could it be because the extensions in your repository are version 5.2.10-6 and not 5.3.0?

# yum list –enablerepo=webtatic php-mhash*
–snip–
Installed Packages
php-mhash.i386 5.2.6-1.el5.art installed
Available Packages
php-mhash.i386 5.2.10-6 webtatic
Reply
*
Andrew Thompson says:
5th August 2009 at 6:37 pm

@Matt
PHP 5.3 made mhash obsolite, and moved its functionality into php-hash which is installed by default.

I’ll compile a new version of 5.3 with the correct obsolite’s
25.
Joomla Developer says:
9th August 2009 at 4:39 am

Thanks a lot this worked like a charm on my CentOS 5.3 installation.
Reply
26.
Chas says:
11th August 2009 at 10:32 pm

Hmm the 5.4.10 seems have have broken some extensions and phpmyadmin

error_log:
Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mysqli.so’ – /usr/lib/php/modules/mysqli.so: undefined symbol: executor_globals in Unknown on line 0

Linux yn 2.6.16.38-xenU #2 SMP Wed Aug 13 21:03:44 EDT 2008 i686 i686 i386 GNU/Linux

I installed the glibc compatability libraries but that didn’t help

suggestions? I’m rolling back for now – Chas.
Reply
27.
waynem says:
15th August 2009 at 3:02 am

I installed the PHP 5.3 on a Centos 5.3 unit, and it loaded and installed great, however, I needed to use either Zend or Ioncube with my software, and neither products have a PHP 5.3 compatible product. They will however work with PHP 5.2.10 I tried to re-install your 5.2.10 version, but it gives errors stating that no files were marked for “upgrade”. Probably because they are now 5.3 version, and 5.2.10 would be a “rollback” in versions. How can I rollback your PHP 5.3 upgrade and then install the 5.2.10 version ??

I am sure others will also run into this problem.

Thanks,
Wayne
Reply
28.
Andrew Thompson says:
15th August 2009 at 12:38 pm

Sorry about the 5.2.10 version not working before. I rebuilt exactly the same spec on another server and it now works.

As for downgrading, there doesn’t seem to be any easy way other than to “yum remove php*” then install again with the exclude (the yum-allowdowngrade plugin doesn’t seem to work), .
Reply
29.
waynem says:
17th August 2009 at 5:40 pm

The removal worked great, however, when I now try to update ( or “install” ) to the 5.2.10 version with the –exclude=*5.3* tag I get that I am missing dependencies for php-common = 5.2.10-6.1 and php-cli = 5.2.10-6.1 !!!

And the “update” will not load these dependencies.

Is there anyway to load these separately, so the php-5.2.10 version will load and run properly ?

Thanks again,
Wayne
Reply
30.
waynem says:
17th August 2009 at 8:43 pm

I was able to manually re-install the 5.2.10 versions using your RPMs and all is well.

Thank you,
Hopefully Zend and ION cube will get their act together and we can then upgrade to the 5.3 version.

Wayne
Reply
*
Andrew Thompson says:
18th August 2009 at 12:47 pm

Yep, you can manually install individual or multiple packages via rpm,
e.g.
rpm -i http://repo.webtatic.com/yum/centos/5/i386/php-cli-5.2.10-6.1.i386.rpm

Wish I could work out how people get to the state of the repository not finding packages, but in all my tests I haven’t found any problems. In theory it should work exactly correct if not having mixed up with other repositories or guides.
31.
rhino says:
27th August 2009 at 8:26 pm

Nice work! I was able to update my centos5 box to php5.3 when remi’s repo was missing a dependency…yours worked like a champ. Thanks!
Reply
32.
Kevin Lane says:
31st August 2009 at 5:34 am

Hi. I was having the same issue with no updates found until I realized that the version of CentOS I installed had priorities enabled by default. I had to put: priority=1 into your repo to make it find the updates.

Thanks for this page though as it helped a lot.
Reply
33.
Alex W says:
1st September 2009 at 8:56 pm

Although Andrew has already said it, I’m going to repeat that if you are missing packages, you can download and individually install them from here

http://repo.webtatic.com/yum/centos/5/i386/

With the 5.2.10 install, I found that mcrypt wasn’t being installed when I did

yum –enablerepo=webtatic –exclude=php*5.3* update php

but I was able to download it and install it manually afterwards

(and thanks Andrew, you’ve been a life saver)
Reply
34.
various ramblings says:
2nd September 2009 at 12:51 pm

[...] installing php5.3 with xml support on centos [...]
Reply
35.
Camulos says:
8th September 2009 at 9:16 am

thanx so much! I was looking for this :) ( PHP 5.2.10 !!)
Reply
36.
Alex says:
17th September 2009 at 1:05 am

You’re a life saver. One thing you have to add is XCache 1.3.0 which supports PHP 5.3. I dug up your email addy and I’ll email you the srpm.

Thanks!
Alex
Reply
37.
Deep says:
19th September 2009 at 5:06 pm

Hi Andy,

I managed to upgrade my PHP from 5.1.6 to 5.2.10. But then I wanted to install imap.

I did yum install php-imap, which surprisingly looking at the older version

[root@00:16:3e:69:96:bf-my00001 yum.repos.d]# yum install php-imap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* epel: mirror.nus.edu.sg
* updates: mirror.nus.edu.sg
* base: mirror.nus.edu.sg
* addons: mirror.nus.edu.sg
* extras: mirror.nus.edu.sg
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
–> Running transaction check
—> Package php-imap.x86_64 0:5.1.6-23.2.el5_3 set to be updated
–> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php-imap
–> Processing Dependency: libc-client.so.1()(64bit) for package: php-imap
–> Running transaction check
—> Package php-imap.x86_64 0:5.1.6-23.2.el5_3 set to be updated
–> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php-imap
—> Package libc-client.x86_64 0:2004g-2.2.1 set to be updated
–> Finished Dependency Resolution
php-imap-5.1.6-23.2.el5_3.x86_64 from updates has depsolving problems
–> Missing Dependency: php-common = 5.1.6-23.2.el5_3 is needed by package php-imap-5.1.6-23.2.el5_3.x86_64 (updates)
Error: Missing Dependency: php-common = 5.1.6-23.2.el5_3 is needed by package php-imap-5.1.6-23.2.el5_3.x86_64 (updates)

I tried to run the rpm directly from your server:

# rpm -i http://repo.webtatic.com/yum/centos/5/x86_64/php-imap-5.2.11-1.x86_64.rp...

but this is giving me error:

error: Failed dependencies:
libc-client.so.1()(64bit) is needed by php-imap-5.2.11-1.x86_64

Need your help.

Thanx in advance.

Regards,
Deep
Reply
*
Andrew Thompson says:
20th September 2009 at 2:43 pm

Hi Deep,

You need to set the enablerepo flag whenever you install any packages that depend on my version, e.g.
yum install –enablerepo=webtatic php-imap

Also the reason the rpm -i failed was because rpm on its own doesn’t resolve dependencies. You would need to install the dependency beforehand.

You can lookup the package that the dependency is in by doing:
yum provides libc-client.so.1

In this case its libc-client, but names aren’t always the same.
38.
PHP 5.3 « devspan says:
28th September 2009 at 7:02 pm

[...] only has PHP 5.1 in it’s repository but Andy Thomson is hosting a 5.3 repo at Webtatic.com with a step by step guide on installing it from fresh or [...]
Reply
39.
John says:
17th October 2009 at 4:56 pm

Hi, I think I’ve everything set up! Thankyou for your great job!

I’m just missing the php_mysql.so : where can I find it?
Reply
*
Andrew Thompson says:
23rd October 2009 at 6:22 pm

php_mysql.so should be part of the php-mysql package (along with mysqli, pdo_mysql). Is yum not resolving it as a dependency?
40.
Jonathan Lambert says:
19th October 2009 at 1:34 pm

http://us2.php.net/manual/en/pcre.installation.php

It looks like you compiled PCRE support without –enable-utf8… this breaks frameworks like Kohana, which require it. Not sure how to fix this without recompiling (which is what I did) from source.

I might suggest it. :)

TY for your efforts!
Reply
*
Andrew Thompson says:
23rd October 2009 at 6:21 pm

Interesting, I only really modified the Fedora PHP package, so it only has the configure options that that adds.

Maybe though PHP 5.3 acts differently with this option and I need to add it. I’ll have a look later next week.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

http://fri8nd.egloos.com/2629817

PHP 설치 리눅스관련

* 작성시간 : 2009/10/12 16:21
* 퍼머링크 : fri8nd.egloos.com/2629817
* 작성자 : ceojune
* 덧글수 : 0

PHP 설치과정에 대해서 이야기 하고자 한다.

PHP 와 아파치를 동적으로 연동하기 위해서는 몇가지 설정이 필요하며, 아파치가 동적으로 돌아가기 위해서 DSO support 형식으로 PHP 가 지원 하여야 한다.

PHP 설치도 다른 어플리케이션과 마찬가지로

Source 설치 및 RPM 설치가 있다. RPM 방식설치는 레드햇 엔터프라이즈 5.4 버전에서 설치 되어있다.

일단은 RPM 형식으로 설치 되어있는 PHP 를 삭제를 해야한다.

#rpm -qa | grep php

하게 되면, php 에 대한 rpm 패키지들이 설치 되어있는지 확인해 볼 수 있다.

삭제를 위해서는

#rpm -e 해당rpm

해서 삭제가 가능 하다.

패키지가 연동되어있기 때문에 의존성을 무시하고 설치하려면,

#rpm -e php --nodeps <= nodeps 옵션을 줘야 삭제가 가능 하다.

이렇게 해서 PHP 를 삭제하였다면,

www.PHP.net 에 접속해서 php 를 다운 받도록 하자.

다운 받은 파일을 압축을 해제 하면

#tar zxvf php.5.3.0.tar.gz 으로 압축을 해제 하자 !

압축을 해제 했다면 설정을 컴파일 하기 전에 설정을 먼저 해줘야한다.

# ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql-=/usr/local/mysql
--with-config-file-path=/usr/local/apache/conf --with-exec-dir=/usr/local/apache/bin

으로 설정을 해줘야한다.

위와 같이 설정을 하는 이유는
--with-apxs2 는 PHP 가 아파치 데몬에 DSO 모듈로 로딩되도록 하기 위해서 apxs 파일을 위치 지정하는 것이고
--with-mysql 은 mysql과 연동하기 위해서 설치되어있는 위치를 가르키는 일이다.
--with-config-file-path 는 php.ini 파일 경로를 지정하는 옵션이며,
--with-exec-dir 은 아파치 데몬의 실행경로를 지정하는 일을 한다.

위와 같이 설정이 끝났다면, #make && make instaill

php 소스가 있는 곳에서
#cp php.ini-production /usr/local/apache/conf/php.ini 를 복사한다.

apache 설정을 해줘야하는 데 /usr/local/apache/conf/httpd.conf 파일을 vi 로 열어서

ServerName 을 편집해주고,
AddType 이 있는 부분에
AddType application/x-httpd-php .php .html .html .inc .php5 .php4
AddType application/x-httpd-php-source .phps
를 설정해준다.

이 설정은 파일을 해석할 때 어떠한 확장자를 해석 할 수 있는지 정의 해주는 부분이다.

이 후 apache 를 재시작 해주면 된다.
# /usr/local/apache/bin/apachectl restart

빵 !!

하면 된다... .....

But......

# /usr/local/apache/bin/apachectl start
httpd: Syntax error on line 99 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied

위와 같은 메세지를 만나게 될 것이다. ! 봉착 문제의 봉착 !
문제가 발생한것이다. 이것은 PHP 가 동적으로 DSO 모듈로 제대로 선언되지 못한것과 Shared Object 의 보안 설정 문제나 SeLInux 문제 일 수 있습니다.

이것을 해결하기 위해서는 PHP 동적 모듈이 문제 일 경우는 압축 해제 부터 다시 해서 해결 하면 되며,

보안 설정 문제 이면 아래와 같이 해결 하면 됩니다.

#/sbin/restorecon -R -v /usr/local/apache/modules/libphp5.so

#/usr/bin/chcon -t texrel_shlib_t /usr/local/apache/modules/libphp5.so

위와 같이 해결시에도 문제가 해결 되지 않은 경우 SELinux 를 설정을 해줘야한다.

# /etc/sysconfig/selinux 파일을 vi 로 열어서 아래의 항목과 같이 SELinux 를 해제 해줘야한다. !

SELINUX=disabled

위와 같이 해결 하면 된다.

이상 mysql + apache + php 연동으로 서버 구축을 해보았음.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

http://jonnychoe.egloos.com/5101760

[CentOS5.3] APM 설치 Linux

* by 멋진쟈니
* 2009/09/03 17:14
* jonnychoe.egloos.com/5101760
* 덧글수 : 0

<1.mysql>

./configure --prefix=/usr/local/mysql --localstatedir=/home/sqldata --enable-assembler --without-debug --with-mysqld-user=mysql --with-charset=utf8 --with-extra-charsets=complex --enable-thread-safe-client

컴파일시 에러뜨면 아래 설치
rpm -qa |grep gcc
yum -y install gcc-c++ gcc-gfortran

make
make install

/usr/local/mysql/bin/mysql_install_db
/usr/local/mysql/bin/mysqld_safe &

/usr/local/mysql/bin/mysqladmin -u root password '암호'
접속
/usr/local/mysql/bin/mysql -u root -p
show databases;

<2.apache2>

/server/mpm/prefork/prefork.c 파일에서
#define DEFAULT_SERVER_LIMIT 4096(256->4096)

/server/mpm/worker/worker.c 파일에서
#define DEFAULT_THREAD_LIMIT 256

./configure --prefix=/usr/local/apache2 --enable-so --enable-modules=all --enable-mods-shared=all --enable-ssl=shared --enable-rewrite=shared --enable-cache --enable-disk-cache --enable-mem-cache

<3.php>

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-sysvshm=yes --enable-sysvsem=yes --enable-debug=no --enable-track-vars=yes --with-ttf --with-iconv --enable-mbstring --enable-sockets --with-freetype-dir=/usr/local/freetype --enable-mbregex --enable-exif --with-gd --enable-gd-native-ttf --with-xmlrpc --with-config-file-path=/usr/local/php --with-ldap=/usr --with-zlib-dir=/usr/lib --enable-calendar

make: warning: Clock skew detected. Your build may be incomplete.

의미

컴파일 한 파일들이 현재의 시스템 시간보다 빠른다는 의미다.

해결 방법

file의 시간을 변경 해주면 된다.

컴파일 하기전 아래의 명령어를 실행시킨다.

touch *

Apache : "Cannot load /usr/local/apache2/modules/libphp5.so"
# service httpd restart
httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied

SOLUTION ......................................

chcon -t texrel_shlib_t /usr/local/apache2/modules/libphp5.so

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Redhat 7.3 에서는 SQL서버를 설치하면 기본적으로 Mysql이 아닌 pgsql (postgress SQL)을 기본 DB로 PHP가 설정됩니다. (이는 phpinfo 파일에서 확인할 수 있음)
이것도 모르고 당연히 RPM으로 설치하면 PHP와 Mysql 이 연동 가능하리라 생각하신분들 많으셨을겁니다.

Mysql 과 PHP 를 RPM 으로 연동시켜주기 위해서 php-mysql 모듈이 필요한데 Redhat Linux CD 배포판 에서는 어찌된일인지 php-mysql-7.x.x.rpm 파일을 포함하고 있지 않습니다.

따 라서 현재 설치되어 있는 PHP 버젼과 동일한 버젼의 php-mysql RPM 패키지를 구하여서 설치한후 php.ini 파일에 mysql.so 모듈을 등록시켜준 다음 apache 를 다시띄워주면 PHP와 Mysql 이 연동됩니다. (phpinfo 파일을 확인해보시면 Mysql 이 등록되어 있음을 확인할수 있음)

파일다운로드 http://rpmfind.rediris.es/

RPM 설치후 제로보드를 사용하시고자 하시는 분들은 꼭 확인하세요. 참고로 php.ini 에서 file upload 가 기본적으로 Off 되어 있다는 사실도 확인하세요 !!

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

CentOS 와 PHP5.2

* Posted at 2009/03/25 14:01

CentOS 는 태생이 RHEL 계열인지라, RehHat에서 PHP 버전을 관리하는 방식을 따르게 됩니다. 설치형 블로그인 textcube도 PHP 5.2 이상을 지원한다고 선언한 이 마당에서, 아직 RHEL 계열이 5.1에서 멈춰있군요.

이런 쓰레드도 있고, 이런 쓰레드도 있네요. 둘다 PHP5.2를 언제 지원할 예정이냐는 이야기들입니다.

더 찾아보니, Upgrading to PHP 5.2.3 on RHEL and CentOS 이라는 글이 있군요.

Source 받아서 rpmbuild --rebuild php-5.2.5-jason.2.src.rpm 로 간단히 rpm을 만들 수가 있고, /usr/src/RPMS 에서 찾으시면될 것 같습니다.

http://www.php.net/

phpmyadmin을 사용하려하니, yum install phpmyadmin 이 안먹혔다.
그래서, 어차피 /var/www/html(centos,redhat)안에서 웹페이지처럼
작동할것이라서, 그냥 갖다가 복사해놨다.
그런데, php5.2 이상을 요구한다고 문구를 내보내며, 작동이 안됐다.

그래서 이젠 아예 누가 하는것처럼 5.2이상버젼(소스)을 가져다가
rpm으로 컴파일한후에 설치할 생각을 하게됐다.
http://www.php.net/에가서, 5.30으로 받았다.

/usr/src/soso/폴더를 만들어서, 그안에다 압축을 풀어놓고는,
soso/php-5.3.0/로 들어가서.
.configure

http://www.zend.com/en/products/server-ce/downloads

CD굽기_CentOS

http://www.linuxtopia.org/online_books/centos_linux_guides/centos_linux_...

00 mkisofs명령 이미지만들기

mkisofs명령은 iso9660규격으로 CD, DVD용 이미지를 만들고, 거의모든
종류의 파일을 iso에 포함할수있고, CD는 760m이하, DVD는 4.7G이하로
파일을 용량을 제한해야 합니다.

/home/user/폴더를 백업하고싶고, /home/user/junk/폴더내용은 불필요해서,
빼고, 래드햇이나, 윈도우에서 사용가능한 iso9660의 iso이미지를 제작하는
명령어는::

mkisofs -o backup.iso -x /home/joeuser/junk/ -J -R -A -V -v /home/joeuser/

제작된 iso이미지는 커서가 있는 현재폴더에 만들어지고,
또한 만들어진 iso이미지는 cdrecord명령으로 CDR,CDRW,
DVDR,DVDRW 로 구울수 있습니다.

mkisofs --help를 실행하면, 엄청난 옵션을 볼수있고,
나중에 LiveDVD용 iso이미지를 만들때 유용할것입니다.

00 cdrecord DVD굽기명령

cdrecord는 매우 강력한 CDR, CDRW, DVDR, DVDRW 를
굽는 명령어입니다.
굽는 명령을 실행하기전에 자신의 DVDROM의 디바이스주소를
알아내는 명령을 먼저 실행하여야합니다.
cdrecord -scanbus 를 실행하면 아래와 같이 디바이스상태가
출력됩니다.
출력된 자신의 디바이스주소를
cdrecord명령어를 적을때, 옵션란에다, 적어주기 위해서입니다.

0,0,0 0) 'HL-DT-ST' 'DVDRAM GH22LS50 ' 'TL01'
0,1,0 1) *
0,2,0 2) *
0,3,0 3) *
0,4,0 4) *
0,5,0 5) *
0,6,0 6) *
0,7,0 7) *

바로위에서, mkisofs로 백업형태로 만든 iso화일같은 경우는,
꼭 root사용자상태에서 명령을 실행해야하고,
그렇치않은 경우라도, CD,DVD매체를 뻑내지않기위해서는,
root사용자상태에서 작업해야할것같습니니다.

참고로 터미널상태에서, 완전한 root사용자를 만들기위해서는,
래드햇, 페도라, 센토스에서는,
su -엔터누름, 또는 su - root엔터누름 을 해주면됩니다.
우분투에서 보통쓰던 su엔터누름, su root엔터누름이 아니고,

위에 나온 표는 예시로 보이는 cdrom형식일뿐입니다,
먼저 자신의 cdrom형식을 알기위해선,
cdrecord -scanbus를 실행한후에,
굽기명령으로 실행해야합니다.
cdrecord -v -eject speed=4 dev=0,0,0 backup.iso

쓰기속도 4배속 디바이스주소 0,3,0 자세한설명 -v
완료후디스크꺼냄 -eject

CDRW,DVDRW 자료를 지우는명령
물론 여기서도 자신의 DVD의 디바이스주소를 알아내기위하여,
cdrecord -scanbus를 실행해서 나온 결과값을 보고나서,
그것을 넣어줘야합니니다.

cdrecord -eject --dev=0,0,0 --blank=all

디바이스주소 (0,0,0), 지우기=모두다.

윈도우에서 네로, 알콜 로 익숙하게 시디를 구워보다,
리눅스에서, 그래도 우분투, 데비안에서는 그런데로,
브라세 인지, 그런 GUI형식의 시디굽는 프로그램이
있는데, 센토스엔 없어서, 뻑날까봐 좀 신경도 쓰여서,
먼저 RW로 실험을 해본후에, CDR을 구워봤는데,
잘구워졌고, 명령어를 직접 적어넣어줘서 하는것빼고는,
윈도우에서 쓰던 GUI방식의 네로와 다른게 없었습니다.
이상입니다.

CentOS54 웹서버동작

00 CentOS 터미널에서, 완전한 root권한취득법은
su -엔터, su - root엔터 이다.
센토스, 래드햇, 페도라은 같은 계열이므로
같을것으로 추정된다.
보통 우분투에서의 방법으로는 반쪽짜리 root권한만을
얻을수있다. 그것을 실험해보는 방법은
시스템의 보안과 관련있는 명령인 ntsysv를 해봐서,
잘되면, 완전한root, 안되면 반쪽자리root로 판별함,
su엔터, su root엔터 이것들이 반쪽짜리다.

00. ntsysv로 다양한서비스를 개폐할수있다.
esc,tab,space,enter키로 조절한다.

00 standalone방식(독립식, 각자놀기식,지방분권식,군현통치제)과,
inetd방식(중앙집중식, 중앙통제식, 왕권통치제)이 있는데,
아니 이젠 inetd방식은 더욱더 진화해서, xinetd방식으로
현재 쓰여지고있다. xinetd방식은 중앙처리방식, 종합관리방식이다.


00 xinetd의 시작과 종료해보기

#cat /etc/services | more
이렇게하면 서비스상황을 한눈에 볼수있다.

#/etc/rc.d/init.d/xinetd stop
#/etc/rc.d/init.d/xinetd start
#/etc/rc.d/init.d/xinetd restart

#vi /etc/xinetd.conf
#cd /etc/xinetd.d
/etc/xinetd.d/# ls
이안에 있는 파일들은 각각의 서비스구성화일이다.
vi로 열어서 편집해주면 서비스를 개폐할수있다.
주로 disable = no 로 바꿔어주면 가능상태로 바뀐다.

#vi /etc/httpd/conf/httpd.conf
#/etc/rc.d/init.d/httpd start
#/etc/rc.d/init.d/httpd stop
#/etc/rc.d/init.d/httpd restart

#ps -ef | grep httpd
위에서처럼 서비스를 활성, 비활성으로 바꾸는것은
일회성이어서, 지금 현재의 부팅상태에서는
통용되는 방식이나. 나중에 재부팅됐을때조차도,
통용되게하려면, ntsysv를 실행한후에,
httpd를 체크하고 확인을 눌러줘야한다.

00 이번엔 아파치와 친구인 mysql에 대한것이다.

#mysql
#ps -ef | grep mysql

2009년 10월 24일 토요일

Cent OS 커널컴파일

CentOS 54, 커널컴파일,

00 CentOS는 Fedora, RedHat 의 친구사이라, 같을줄 알았는데,

조금은 달랐다.

00 먼저 CentOS용 커널컴파일도구를 다운받는다.

# yum install gcc
# yum install ncurses-devel
# yum install rpm-build
# yum install bison

00 커널소스를 다운받고, 압축을 푼다.

# cd /usr/src

/usr/src/ # wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.32-rc5.tar...

/usr/src/ # tar xvjf linux-2.6.32-rc5.tar.bz2

/usr/src/ # ln -s linux-2.6.32-rc5 linux

00 메뉴구성및 청소,

cd /usr/src/linux

/usr/src/linux/ # make clean

/usr/src/linux/ # make mrproper

/usr/src/linux/ # make menuconfig

00 컴파일실행

/usr/src/linux/ # make rpm

00 커널생성확인작업,

에러없이 잘됐다면,

/usr/src/redhat/SRPMS/ 에는

kernel-2.6.32rc5-1.src.rpm 이 생기고,

그리고, 자신의 CPU종류에 따라서, 각기다른폴더안에 만들어지는데,

뭐,, 그렇다고, 전혀 다른폴더는 아니고,

/usr/src/redhat/RMPS/ 이 안에 다양한 폴더가 있는데,

그것들이 모두 CPU종류별로 구분돼있는것이다.

지금 사용중인 나의 CPU는 32비트용 이므로,

컴파일작업한 커널이

/usr/src/redhat/RPMS/i386 안에 만들어진다.

다른타입의 CPU라면 옆에 폴더에 만들어질것이다.

만들어진 커널이미지의 이름은,

kernel-2.6.32rc5-1.i386.rpm 으로 만들어진다.

00 커널설치작업

이젠 그리로 들어가서,

# cd /usr/src/redhat/RPMS/i386

바로 여기서 커널설치명령을 내린다.

# rpm -ivh --nodeps kernel-2.6.32rc5-1.i386.rpm

여기서 --nodeps 는 의존성에러방지용이다.

00 이젠 ramdisk를 수동으로 만들어야한다.
이게없으면 부팅이 안되기 때문이다.

# cd /boot

boot/ # mkinitrd initrd-2.6.32-rc5.img 2.6.32-rc5

00 grub.conf에다 새로운커널을 적용하는 문구를 적어줘야한다.

cd /boot/grub

/boot/grub/ # vi grub.conf

/boot/grub/ # vi menu.lst

00 재부팅

# reboot

00 재부팅후에 uname -r 해줘서,
새로운 커널명이 나오면 커널작업이 성공한것이다.

수동명령(Fedora식 명령)
yum install rpm-build 를 안하고하니,
에러유발로 이렇게도 해봤다.
그러나, 이것 적용 안할 예정

make all
make modules_install
make install

그리고,
vi /etc/modprobe.conf 로 수정해줘야한다는데,
글쎄 그건 자동으로 되는것같은데,

커널을 완전히 설치한후에,

1. 모듈들의 의존성을 만들어주기위해서,

# depmod 2.6.32-rc5 를 한다드라,

2./boot/ # mkinitrd -v initrd-2.6.32-rc5.img 2.6.32-rc5

이렇게하다 에러 나오면, No module dm-mem-cache found for kernel 2.6.32-rc5, aborting.

/boot/ # mkinitrd --without-dmraid -v initrd-2.6.32-rc5.img 2.6.32-rc5

그런데, 여기서,,
depmod 와 mkinitrd 명령이 안먹힌다.
yum으로보니, 물건은 있다는데,
왜 작동을 안하냐고???
나중에 보자...

3./boot/grub/grub.conf 를 수정해야한다.
밑에 내용을 참고할것,

1 title CentOS (2.6.32-rc5)
2 root (hd0,0)
3 kernel /vmlinuz-2.6.32-rc5 ro root=/dev/VolGroup00/LogVol00
4 initrd /initrd-2.6.32-rc5.img

The file /boot/grub/grub.conf will be like this:

01 # grub.conf generated by anaconda
02 #
03 # Note that you do not have to rerun grub after making changes to this file
04 # NOTICE: You have a /boot partition. This means that
05 # all kernel and initrd paths are relative to /boot/, eg.
06 # root (hd0,0)
07 # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
08 # initrd /initrd-version.img
09 #boot=/dev/sda
10 default=0
11 timeout=5
12 splashimage=(hd0,0)/grub/splash.xpm.gz
13 hiddenmenu
14 title CentOS (2.6.18-128.el5)
15 root (hd0,0)
16 kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/VolGroup00/LogVol00
17 initrd /initrd-2.6.18-128.el5.img
18 title CentOS (2.6.32-rc5)
19 root (hd0,0)
20 kernel /vmlinuz-2.6.32-rc5 ro root=/dev/VolGroup00/LogVol00
21 initrd /initrd-2.6.32-rc5.img


http://www.fogonacaixadagua.com.br/2009/09/how-to-compile-a-new-kernel-i...

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

[root@localhost boot]# ls -al
합계 46813
drwxr-xr-x 4 root root 1024 10월 25 13:22 .
drwxr-xr-x 23 root root 4096 10월 25 11:22 ..
-rw-r--r-- 1 root root 161 9월 3 18:16 .vmlinuz-2.6.18-164.el5xen.hmac
-rw-r--r-- 1 root root 952318 9월 3 18:16 System.map-2.6.18-164.el5xen
-rw-r--r-- 1 root root 1293759 10월 25 12:54 System.map-2.6.32-rc5
-rw-r--r-- 1 root root 68285 9월 3 18:16 config-2.6.18-164.el5xen
-rw-r--r-- 1 root root 82676 10월 25 12:54 config-2.6.32-rc5
drwxr-xr-x 2 root root 1024 10월 25 13:38 grub
-rw------- 1 root root 3234265 10월 24 18:22 initrd-2.6.18-164.el5xen.img
drwx------ 2 root root 12288 10월 24 18:11 lost+found
-rw-r--r-- 1 root root 80032 3월 13 2009 message
-rw-r--r-- 1 root root 107385 9월 3 18:16 symvers-2.6.18-164.el5xen.gz
-rwxr-xr-x 1 root root 36121495 10월 25 12:42 vmlinux-2.6.32-rc5.bz2
-rw-r--r-- 1 root root 2225793 9월 3 18:16 vmlinuz-2.6.18-164.el5xen
-rw-r--r-- 1 root root 2332320 10월 25 12:54 vmlinuz-2.6.32-rc5
-rwxr-xr-x 1 root root 817160 9월 3 19:06 xen-syms-2.6.18-164.el5
-rw-r--r-- 1 root root 375877 9월 3 16:27 xen.gz-2.6.18-164.el5

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

[root@localhost grub]# ls -al
합계 263
drwxr-xr-x 2 root root 1024 10월 25 13:38 .
drwxr-xr-x 4 root root 1024 10월 25 13:22 ..
-rw-r--r-- 1 root root 63 10월 24 18:33 device.map
-rw-r--r-- 1 root root 7584 10월 24 18:33 e2fs_stage1_5
-rw-r--r-- 1 root root 7456 10월 24 18:33 fat_stage1_5
-rw-r--r-- 1 root root 6720 10월 24 18:33 ffs_stage1_5
-rw------- 1 root root 855 10월 25 13:34 grub.conf
-rw------- 1 root root 646 10월 25 13:30 grub2.conf
-rw-r--r-- 1 root root 6720 10월 24 18:33 iso9660_stage1_5
-rw-r--r-- 1 root root 8192 10월 24 18:33 jfs_stage1_5
lrwxrwxrwx 1 root root 11 10월 24 18:33 menu.lst -> ./grub.conf
-rw-r--r-- 1 root root 6880 10월 24 18:33 minix_stage1_5
-rw-r--r-- 1 root root 9248 10월 24 18:33 reiserfs_stage1_5
-rw-r--r-- 1 root root 55808 3월 13 2009 splash.xpm.gz
-rw-r--r-- 1 root root 512 10월 24 18:33 stage1
-rw-r--r-- 1 root root 104988 10월 24 18:33 stage2
-rw-r--r-- 1 root root 7072 10월 24 18:33 ufs2_stage1_5
-rw-r--r-- 1 root root 6272 10월 24 18:33 vstafs_stage1_5
-rw-r--r-- 1 root root 8904 10월 24 18:33 xfs_stage1_5

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

/boot/grub/grub.conf

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hdc
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
##title CentOS (2.6.32-rc5)
## root (hd0,0)
## kernel /xen.gz-2.6.32-rc5
## module /vmlinuz-2.6.32-rc5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
## module /initrd-2.6.32-rc5.img

title CentOS (2.6.18-164.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-164.el5
module /vmlinuz-2.6.18-164.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.18-164.el5xen.img

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

이건 분위기바꿔서, /boot/안의 화일과
/boot/grub/grub.conf 의 내용중에서,
xen어쩌구,, 하는 화일 때문인데,
그것을 해결하려면, menuconfig를
다시 해야겠네,,
rpm이 웬수다.

http://derwynd.com/2008/11/10/fedoraredhat-kernel-rpm-with-xen-reiserfs/

https://lists.sdsc.edu/pipermail/npaci-rocks-discussion/2008-September/0...

Fedora/Redhat Kernel RPM with Xen & reiserfs

Posted On November 10, 2008

Filed under Uncategorized

Comments Dropped leave a response

Download the src rpm

(eg. kernel-2.6.18-92.el5.src.rpm)

$ rpm -ivh kernel-2.6.18-92.el5.src.rpm

$ cd /usr/src/redhat/SPECS/

$ rpmbuild -bb kernel-2.6.spec

This will build
kernel-2.6.18-92.el5.x86_64.rpm kernel-devel-2.6.18-92.el5.x86_64.rpm
kernel-debug-2.6.18-92.el5.x86_64.rpm kernel-headers-2.6.18-92.el5.x86_64.rpm
kernel-debug-debuginfo-2.6.18-92.el5.x86_64.rpm kernel-xen-2.6.18-92.el5.x86_64.rpm
kernel-debug-devel-2.6.18-92.el5.x86_64.rpm kernel-xen-debuginfo-2.6.18-92.el5.x86_64.rpm
kernel-debuginfo-2.6.18-92.el5.x86_64.rpm kernel-xen-devel-2.6.18-92.el5.x86_64.rpm
kernel-debuginfo-common-2.6.18-92.el5.x86_64.rpm

Install the following rpm
$ kernel-xen-2.6.18-53.el5 xen-libs

Check the grub.conf file the xen lines will be added

#boot=/dev/sda
default=2
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-53.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-53.el5
module /vmlinuz-2.6.18-53.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.18-53.el5xen.img
title Red Hat Enterprise Linux Server (2.6.18-53.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-53.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-53.el5.img

If you list the files in /boot/ are added
vmlinuz-2.6.18-53.el5
initrd-2.6.18-53.el5.img
xen.gz-2.6.18-53.el5
xen-syms-2.6.18-53.el5

Now to build the kernel from the BUILD dir

$ cd /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.x86_64/
$ make menuconfig

——————————————————————-

Processor type and features —>
[*] Enable Xen compatible kernel

File systems —>
Reiserfs support
[ ] Enable reiserfs debug mode
[ ] Stats in /proc/fs/reiserfs
[*] ReiserFS extended attributes
[ ] ReiserFS POSIX Access Control Lists
[ ] ReiserFS Security Labels

XEN —>
[*] Privileged Guest (domain 0)
<*> Backend driver support
Block-device backend driver
Block-device tap backend driver
Network-device backend driver
[ ] Pipelined transmitter (DANGEROUS)
Network-device loopback driver
PCI-device backend driver
PCI Backend Mode (Virtual PCI) —>
[ ] PCI Backend Debugging
< > TPM-device backend driver
Block-device frontend driver
Network-device frontend driver
<*> Framebuffer-device frontend driver
<*> Keyboard-device frontend driver
[*] Scrub memory before freeing it to Xen
[ ] Disable serial port drivers
<*> Export Xen attributes in sysfs
Xen version compatibility (3.0.2 and later) —>

——————————————————————-
Build the kernel (if you have not changed the Makefile the subversion is EXTRAVERSION = -92.el5debug)

This will create vmlinuz-2.6.18-92.el5debug

$ mkinitrd /boot/initrd-2.6.18-92.el5debug.img 2.6.18-92.el5debug
(For the initrd img)

Add lines to grub.conf
——————————————————————
default=2
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-53.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-53.el5
module /vmlinuz-2.6.18-53.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.18-53.el5xen.img
title Red Hat Enterprise Linux Server (2.6.18-53.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-53.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-53.el5.img
title Red Hat Enterprise Linux Server (2.6.18-53.el5Debxen)
root (hd0,0)
kernel /xen.gz-2.6.18-53.el5
module /vmlinuz-2.6.18-92.el5debug ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.18-92.el5debug.img
——————————————————————

Reboot

xen.gz-2.6.32-rc5
xen.gz-2.6.18-164.el5

grub.conf 와의 관계규명.

xen홈피주소::
http://www.xen.org/
xen details 1::
http://wiki.xensource.com/xenwiki/Korean

xen details 2 centos5::
http://www.howtoforge.com/centos_5.0_xen

xen kernel details::
http://wiki.xensource.com/xenwiki/Kernel.org_Linux_on_Xen

http://wiki.xensource.com/xenwiki/XenDom0Kernels

http://article.gmane.org/gmane.comp.emulators.xen.user/40892

이런저런 xen에 관한 문서를 보면서, 흝어보니,
xen은 커널등을 암호화, 가상화화하는 방법으로 개발된것이고,
물론 커널만이 아니라, 다양한것들을 망라하고 있었다.
그런데 내가 목적으로 했던 2.6.32-rc5 같은 최신버젼에는
적용할수가 현재 없고, xen 개발자들이 연구중에 있는것같다.
여기 센토스54에 있는 2.6.18 버젼이 아직은 xen 을 적용한
최신버젼이고, 나는 여기서, 커널 업을 잠깐 보류해야할것같다.





2009년 10월 22일 목요일

DEBIAN 커널컴파일

데비안은 우분투와 친구사이라 같을줄 알았는데,

조금 다르고, 그것도 아주 중요한 부분에서,

차이점을 보여서 처음엔 좀 당황했었습니다.

시작하겠습니다.

00 커널소스다운로드

# cd /usr/src
/usr/src # wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.32-rc5.tar.bz2
/usr/src # tar xvjf linux-2.6.32-rc5.tar.bz2
/usr/src # ln -s linux-2.6.32-rc5 linux

00 컴파일도구들, 패키지설치,

# apt-get install kernel-package
# apt-get install libncurses5-dev
# apt-get install fakeroot
# apt-get install zlib1g-dev
# apt-get install libssl-dev

00 컴파일설정

# cp /boot/config-xxxx /usr/src/linux/.config
이것은 이전의 컨피그를 재활용하려는 것입니다.
새롭게 구성하려면, 안해도 됩니다.

# make menuconfig
구성작업을 합니다.

00 컴파일 실행

# make-kpkg --initrd --revision=k2 binary-arch
이렇게하면, kernel_image, kernel_image_mysql, header_image 이렇게 3개의 .deb화일이
/usr/src/에 만들어지는데, 아마도 인베이드리눅서들이 쓰는 방법같고,
dpkg로 설치할때도 3개를 따로따로 모두 해주어야합니다.
그래서 인베이드리눅서가 아닌이상,
아래와 같이 단순하게 하여, .deb화일을 1개만 만듭니다.

# make-kpkg --initrd --revision=k2 kernel_image
이것을 실행 시키면, 2-3시간이 걸립니다.
에러없이 제대로 작업이 됐다면, /usr/src/안에 .deb화일이 만들어졌습니다.

00 컴파일된 이미지를 설치합니다.

dpkg -i kernel-image-2.6.32-rc5.deb

여기서 /boot 폴더안으로 들어가 봅니다.
cd /boot
그런데, initrd이미지가 안만들어지는 경우가 있습니다.
내_데비안에서 그런일이 일어나는 바람에 웹을 엄청나게
뒤졌으나, 한국사이트는 물론이고, 외국사이트에도,
몇년전의 lilo시절의 문장들만 있고, 이것은 없었습니다.
그러다 어떻게 어떤 외국사이트에 비슷한 사례를 발견하고는,
힌트를 얻어서 해봤더니 돼더군요,
그래서 그것을 소개합니다.

데비안계열은 다른것은 모두 자동으로 잡아주는데,
initrd_image를 안만들고, /boot/grub/grub.cfg화일안의 내용에도 역시
initrd_image를 안적어놨습니다.
그래서, 먼저 /boot로 들어가서는,

# cd /boot
# mkinitramfs -o initrd.img-2.6.32-rc5 2.6.32-rc5 엔터침
이렇게하여, initrd.img-2.6.32-rc5를 수동으로 만들어놓고는,
/boot/grub/grub.cfg 문장을 nano로 열어서,
이전의 initrd커널이미지문장을 복사해서,
새로작업한 커널문장에다 붙여넣기한후에
겨우 새로운 커널로 부팅할수 있었습니다.

그리고 한번, /lib/modules/폴더안을 살펴보기 바랍니다.
그곳에 각커널별로 모듈들이 모여있습니다.

이상입니다.

팔로어