Author Topic: Changing The User For Apache?  (Read 2015 times)

burao

  • Newbie
  • *
  • Posts: 19
    • View Profile
Changing The User For Apache?
« on: January 07, 2005, 09:28:52 am »
I have Apache/PHP/Mysql running on my 860 now as root.
The problem is that when I power down, the root user is killed.

I want to do development on my Z, but it is a pain to shut down the
process all the time.

I think what I want is a way to run Apache (and then Mysql) from
zaurus instead of root. Anyone know how?

It would also be nice to run both apps from an icon or possibly
start both during boot up.

Any help would be appreciated.
Zaurus 860, Panasonic 1GB SD, Hitachi 4GB Microdrive, Cacko ROM

Tehas

  • Full Member
  • ***
  • Posts: 157
    • View Profile
    • http://users.adelphia.net/~stonerrl/rick/
Changing The User For Apache?
« Reply #1 on: January 07, 2005, 11:48:43 pm »
Here is some info that I posted about running MySQL under the userid daemon instead of root.   https://www.oesf.org/forums/inde...c=9413&hl=mysql  

As far as a start up script, I have ones that "toggle" the application (start it if it's not running or shut it down if it is running).  They use the Opie-Sh package to display a message box and they need the sudo package to allow the user zaurus start the apps.

You can put them in /home/QtPalmtop/bin/ and then create a new icon on one of your tabs using the Tab Manager.  Just point it to the script that you saved.

Here's the one for Apache:
Code: [Select]
#!/bin/bash                                                            
#--------------------------------                                      
# Toggle Apache on/off.                                                
# 2003-06-07 -  r.l. stoner                                            
#--------------------------------                                      
                                                                        
(                                                                      
checkit=`ps -ef | grep http | grep -v grep | wc -l`                    
#echo $checkit                                                          
if [ $checkit -ne 0 ]                                                  
   then                                                                
   echo "Stopping Apache ..."                                          
   sudo killall httpd                                                  
   opie-sh -m -w -t "Apache Toggled" -M "Apache has been terminated." -g
   exit 0                                                              
else                                                                    
   echo "Starting Apache ..."                                          
   sudo /home/www/bin/httpd                                            
   opie-sh -m -I -t "Apache Toggled" -M "Apache has been started." -g  
   exit 0                                                              
fi                                                                      
) > /tmp/doapach.log                                                    
#--- end of script ---#

And the one for MySQL:
Code: [Select]
#!/bin/bash                                                          
#--------------------------------                                    
# Toggle MySQL on/off.                                              
# 2003-06-23 -  r.l. stoner                                          
#--------------------------------                                    
                                                                      
(                                                                    
checkit=`ps -ef | grep mysql | grep -v grep | wc -l`                  
#echo $checkit                                                        
if [ $checkit -ne 0 ]                                                
   then                                                              
   echo "Stopping MySQL ..."                                          
   sudo mysqlstop                                                    
   opie-sh -m -w -t "MySQL Toggled" -M "MySQL has been terminated." -g
   exit 0                                                            
else                                                                  
   echo "Starting MySQL ..."                                          
   sudo mysqlstart                                                    
   opie-sh -m -I -t "MySQL Toggled" -M "MySQL has been started." -g  
   exit 0                                                            
fi                                                                    
) > /tmp/domysql.log                                                  
#--- end of script ---#
+SL-5600 v1.32 ROM (Special pre-emptive kernel with overclock)  +Viking 256CF  +SimpleTech 256CF  +Viking 128SD (as ext2)  +AmbiCom WL1100C +Micro Innovations KB  +Hawking Ethernet CF  
+SL6000L +Lexar 1GB SD (as ext2)  +Windows 98/Me/Nt/XP  +Mandrake 8.1 My Zaurus Page[img]http://users.adelphia.net/~stonerrl/rick/rls_userbar.gif\" border=\"0\" class=\"linked-sig-image\" /]

burao

  • Newbie
  • *
  • Posts: 19
    • View Profile
Changing The User For Apache?
« Reply #2 on: January 08, 2005, 12:51:02 am »
Tehas,
Thank you for your reply. This sounds like what I want.
I am not sure about where best to get Opie-Sh.
Could you point me to a URL?
Also, what is the sudo package? If you send me a URL that explains it,
I will find out for myself.

Thanks again
Zaurus 860, Panasonic 1GB SD, Hitachi 4GB Microdrive, Cacko ROM

Tehas

  • Full Member
  • ***
  • Posts: 157
    • View Profile
    • http://users.adelphia.net/~stonerrl/rick/
Changing The User For Apache?
« Reply #3 on: January 08, 2005, 11:20:58 am »
The Opie-sh is on the Zaurus Software Index.

Opie-sh

sudo is also on the ZSI but the link is dead.  You can get it off of te ZUG.
sudo on ZaurusUserGroup

Sudo allows you to run things that would ordinarily require root to do.  With sudo, you don't need to su to root and supply a password.  On the ZUG download page, they have a link to the sudo homepage for a better description of what it does and how to configure it.
+SL-5600 v1.32 ROM (Special pre-emptive kernel with overclock)  +Viking 256CF  +SimpleTech 256CF  +Viking 128SD (as ext2)  +AmbiCom WL1100C +Micro Innovations KB  +Hawking Ethernet CF  
+SL6000L +Lexar 1GB SD (as ext2)  +Windows 98/Me/Nt/XP  +Mandrake 8.1 My Zaurus Page[img]http://users.adelphia.net/~stonerrl/rick/rls_userbar.gif\" border=\"0\" class=\"linked-sig-image\" /]