Apache Command

/etc/init.d/apache2 start|stop|reload|restart|configtest

Running /etc/init.d/apache2 on its own outputs a help message to detail the various options as listed below:

start – start httpd

startssl – start httpd with -DSSL

stop – stop httpd (sendign SIGTERM to parent)

try-restart – stop httpd and if this succeeds (i.e. if it was running before), start it again.

status – check whether httpd is running

restart – stop httpd if running; start httpd

reload|graceful – do a graceful restart by sending a SIGUSR1 or start if not running

configtest – do a configuration syntax test

extreme-configtest – try to run httpd as nobody (detects more errors by actually loading the configuration, but cannot read SSL certificates)

probe – probe for the necessity of a reload, give out the argument which is required for a reload. (by comparing conf files with pidfile timestamp)

full-server-status – dump a full status screen; requires lynx or w3m and mod_status enabled

server-status – dump a short status screen; requires lynx or w3m and mod_status enabled

help – this screen

IOS: Add UISegmentedControl to a navigation bar

– (void)viewWillAppear:(BOOL)animated
[super viewWillAppear:animated];
UISegmentedControl *segmentSelector = [[UISegmentedControl alloc] initWithItems:segControlItems];
segmentSelector.segmentedControlStyle = UISegmentedControlStyleBar;
segmentSelector.momentary = NO;
[segmentSelector addTarget:self action:@selector(actionSegmentedIndexChanged:) forControlEvents:UIControlEventValueChanged];
[segmentSelector setWidth:40.0 forSegmentAtIndex:0];
[segmentSelector setWidth:40.0 forSegmentAtIndex:1];

UIBarButtonItem *segButton = [[UIBarButtonItem alloc] initWithCustomView:segmentSelector];
self.navigationItem.rightBarButtonItem = segButton;

– (void) actionSegmentedIndexChanged:(id)sender
NSLog(@”selectedSegmentIndex: %d”, segmentSelector.selectedSegmentIndex);