|
|
(6 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| this guide is the steps i went through when i upgraded my “server” hecubus to fedora 8. hecubus serves as a file server (samba and nfs), ftp server (pure-ftp), web server (apache, mysql, and php), and personal video recorder (mythtv). setup for fedora 8 as well as these other packages are detailed. | | this page has been moved to a live guide on track7: [http://www.track7.org/geek/guides/linux-server-setup/ linux server setup: file, ftp, web, and tv] |
| | |
| == gnu/linux (fedora) ==
| |
| this guide uses [url=/geek/computers.php#hecubus]hecubus[/url] as an example. in general, the hardware in hecubus is whatever is left over after i upgrade my main machine. it’s not a server-class machine, but it keeps up okay in the server roles i use it for because there are really only 4 client machines that ever connect to it (the demand on it is relatively light). some may be able to get acceptable results with less powerful hardware, while others may need more powerful hardware. specific requirements are listed at the beginning of each section.
| |
| | |
| a dvd drive and several gigabytes of hard drive space are required for installing fedora 8. there are cd images available as well, but this guide uses a dvd image.
| |
| | |
| fedora install disc images are available at [url]http://fedoraproject.org/get-fedora[/url]. i use the i386 install dvd — i recommend using bittorrent to get the image faster, provided you’re comfortable using a bittorrent client. once downloaded, burn the disc image to a dvd.
| |
| | |
| the fedora install dvd is bootable, so unless your machine is incredibly old, you should be able to simply put the fedora dvd in the dvd drive and boot up the machine to start the fedora installer.
| |
| | |
| once the fedora menu comes up, press enter to install in graphical mode, then choose install or upgrade an existing system. after a while it asks if you want to test your installation media. i generally do this the first time installing from a disc to ensure i had a good download. note that it takes a long time though. after this step, anaconda (the graphical install program) starts up.
| |
| | |
| choose your language and keyboard, then choose install fedora if given the choice between installing and upgrading. the next screen lists any hard disks found on the system and allows you to set partitioning options. i go with the default, then deselect all but my primary hard disk (the other two hold data that i don’t want to lose. also check the box for review and modify partitioning layout. upon clicking next, you will be warned that data will be lost, but that’s only on the primary disk since the others were deselected.
| |
| | |
| on the next screen i don’t want to use lvm, so i make a note of the size of swap, then remove the lvm group that was automatically set up (delete volgroup00, then the lvm pv partition). now create a partition with the type swap the same size as the one in the lvm group, then create an ext3 partition for the rest of the space, mounted at /. i select [i]force to be a primary partition[/i] on both of these. the other drives’ partitions should be given a mount point so that you don’t have to manually add them to [code]/etc/fstab[/code] later.
| |
| | |
| the next screen allows the boot loader (grub) options to be changed, but i just keep the defaults. after that is the networking screen (provided anaconda sees your network adapter). i change hostname to set the hostname manually and enter hecubus since that’s my server’s name. if you don’t use ipv6 (most people probably don’t), you can click the edit button and uncheck [i]enable ipv6 support[/i] — it may speed things up.
| |
| | |
| next is time zone selection, where i find it easiest to click on the map to choose my time zone. i also leave the [i]system clock uses utc[/i] box checked (note that some other operating systems, like windows, don’t let you do this so it may be a bad idea if your dual-booting your server for some reason). next it asks you to specify a password for the root user. since root can do anything this should be a strong password, but you will need it later so make sure you can remember it somehow.
| |
| | |
| after that is software package selection — i deselect everything here and then choose customize now near the bottom, then move on to the next screen. for desktop environments, deselect gnome and if you’re going to install mythtv, select kde. for applications, deselect graphical internet. under development, select development libraries and development tools. select windows file server from under servers, and deselect mail server. the other defaults are fine, so click next, wait a while, then click next again and fedora will start installing. this will likely take a very long time.
| |
| | |
| eventually it will ask you to reboot, and you’ll then get the post-install setup. on the firewall screen, leave SSH checked but don’t check any others — we’ll open those as we set up the servers. i disable selinux, but you may want it on (i’m not sure if it interferes with anything else). on the date and time screen, go to the network time protocol tab and check enable network time protocol. this means you won’t have to worry about your system time being off. on the create user page, i create tempuser with the same as the password — i’ll delete this later after creating users with the ids i want. the system will reboot again if you turned off selinux.
| |
| | |
| log in with tempuser. i do this over ssh from a different machine, but you can log into a gui session on the server if you prefer — just start a terminal after you do. i have my users share a default group so that they are better able to use each others’ files. to create users and groups, you need to become root. both [code]su[/code] and [code]su -[/code] will ask you for the root password and then let you become root, but [code]su -[/code] also gives you root’s context (this means you don’t have to specify the path for administrator commands). you should not log in as root directly. in the rest of this guide, lines starting with $ can be run by a normal user, but lines starting with # must be run as root.
| |
| | |
| create a group with the id you want (i’m using 700 here) and the name you want (i’m using people):
| |
| | |
| [code]# groupadd -g 700 people[/code]
| |
| | |
| create the user(s) using that group as the default, and set a password or the user(s):
| |
| | |
| [code]# useradd -g people -u 703 misterhaan
| |
| # passwd misterhaan[/code]
| |
| | |
| log all the way out, then log in as one of the new users so you can remove the temp user:
| |
| | |
| [code]# userdel tempuser[/code]
| |
| | |
| also turn off services that aren’t needed. my server doesn’t use bluetooth or ipv6, and i will find and apply updates manually:
| |
| | |
| [code]# chkconfig bluetooth off
| |
| # chkconfig ip6tables off
| |
| # chkconfig yum-updatesd off[/code]
| |
| | |
| == file servers (samba and nfs) ==
| |
| samba server allows a linux machine to share some of its directories with windows machines. nfs allows a linux machine to share some of its directories with other linux machines. i set up both of these to be accessible only to my subnet, which is 192.168.x.* (in iptables, i write this as 192.168.x.0/24).
| |
| | |
| the requirements for running a file server are hard drive space (the more the better — i have 390 gig total in my server) and a network adapter.
| |
| | |
| edit (as root) the file [code]/etc/samba/smb.conf[/code] to set your samba server options. for the most part, you can follow the examples in the file to set up shared directories.
| |
| | |
| create samba users with [code]smbpasswd -a username[/code] (omit the -a to change password of existing user). allow smb connections from the lan by adding the following lines to [code]/etc/sysconfig/iptables[/code], just before the first line with -j REJECT:
| |
| | |
| [code]-A RH-Firewall-1-INPUT -p udp -m udp -s 192.168.1.0/24 --dport 137 -j ACCEPT
| |
| -A RH-Firewall-1-INPUT -p udp -m udp -s 192.168.1.0/24 --dport 138 -j ACCEPT
| |
| -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -s 192.168.1.0/24 --dport 139 -j ACCEPT
| |
| -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -s 192.168.1.0/24 --dport 445 -j ACCEPT[/code]
| |
| | |
| most routers default to 192.168.1.* for lan ip addresses — change the 192.168.1.0/24 accordingly if yours is different. after the file has been changed, restart the firewall to apply the changes, start the samba service, then make it autostart:
| |
| | |
| [code]# service iptables restart
| |
| # service smb start
| |
| # chkconfig --level 345 smb on[/code]
| |
| | |
| for nfs, edit [code]/etc/exports[/code] and add one line per directory to share, in the following format:
| |
| | |
| [code]/path/to/share 192.168.1.0/24(rw,insecure,sync)[/code]
| |
| | |
| again, the 192.168.1.0/24 may need to change. run [code]exportfs -ra[/code] to apply the changes made in [code]/etc/exports[/code]. parts of nfs use ports that change when restarted, so the following changes can make force them to use a static port. edit [code]/etc/sysconfig/nfs[/code] and add the following lines (note some of these may only need to be uncommented):
| |
| | |
| [code]RQUOTAD_PORT=875
| |
| LOCKD_TCPPORT=32803
| |
| LOCKD_UDPPORT]32769
| |
| MOUNTD_PORT=892
| |
| STATD_PORT=662[/code]
| |
| | |
| now allow those ports through the firewall with the following in [code]/etc/sysconfig/iptables[/code]:
| |
| | |
| [code]-A RH-Firewall-1-INPUT -m state --state NEW -p tcp -s 192.168.1.0/24 -m multiport --dports 111,662,875,892,2049,32803 -j ACCEPT
| |
| -A RH-Firewall-1-INPUT -m state --state NEW -p udp -s 192.168.1.0/24 -m multiport --dports 111,662,875,892,2049,32769 -j ACCEPT[/code]
| |
| | |
| portmap runs on port 111, and nfsd uses 2049 by default, so that's where those ports come from (the others are from the port settings). apply the new firewall rules, start nfs, and make it autostart:
| |
| | |
| [code]# service iptables restart
| |
| #service nfs start
| |
| # chkconfig --level 345 nfs on[/code]
| |
| | |
| == ftp server (pure-ftpd) ==
| |
| i like to use pure-ftpd as my ftp server, and i compile and install it myself (not sure if there are rpm packages available). download the source from [url=http://download.pureftpd.org/pub/pure-ftpd/releases/]pureftpd.org[/url] — get the latest version with .tar.bz2 as it's a bit smaller than .tar.gz.
| |
| | |
| i put things i build and install under [code]/opt/[/code], so the next step is to create [code]/opt/src/[/code] and then cd into it. extract the pure-ftpd source:
| |
| | |
| [code]# tar xjvf /path/to/pure-ftpd-1.0.21.tar.bz2[/code]
| |
| | |
| the source will extract into a directory named pure-ftpd-1.0.21, so cd into that and run these two commands to configure and install pure-ftpd:
| |
| | |
| [code]$ ./configure --without-banner --with-paranoidmsg --with-virtualchroot --with-ftpwho
| |
| # make install-strip
| |
| # cp contrib/redhat.init /etc/rc.d/init.d/pure-ftpd[/code]
| |
| | |
| edit [code]/etc/rc.d/init.d/pure-ftpd[/code] and change “prog=pure-config.pl” to “prog=pure-ftpd” and “$fullpath /etc/pure-ftpd.conf --daemonize” to “$fullpath -A -Z -S ## -P #.#.#.# -p 50000:50100 -u ### &”. the numbers to fill in are ## = the port you want to serve ftp on (default is 21, but i change mine so have to put that here), #.#.#.# = the public (internet) ip of the server, ### = lowest user id that can log in via ftp. now start and set for automatic start:
| |
| | |
| [code]# chmod 755 /etc/rc.d/init.d/pure-ftpd
| |
| # service pure-ftpd start
| |
| # chkconfig --add pure-ftpd[/code]
| |
| | |
| now ftp should be running, but it's not accessible yet. open port ## (set above) and ports 50000:50100 (also set above) by adding these lines to [code]/etc/sysconfig/iptables[/code]:
| |
| | |
| [code]-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport ## -j ACCEPT
| |
| -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 50000:50100 -j ACCEPT[/code]
| |
| | |
| restart the firewall with [code]service iptables restart[/code]. i run my ftp accessible from the internet (so i can get my stuff when i’m not at home), so since my server is behind a router i also need to forward ports ## and 50000:50100 in my router configuration to my server. this is probably different for different routers, but for many the first step is to load up http://192.168.1.1/ in a browser.
| |
| | |
| this ftp configuration will only allow passive mode connections, and users will only see the contents of their home directory. for ftp-only users, i create a directory [code]/ftphome/[/code] with subdirectory [code]std/[/code] and other subdirectories for users that should see other directories. i then create ftp-only users with a command like the following:
| |
| | |
| [code]# useradd -g ftpgroupname -u ### -d /ftphome/std -s /sbin/nologin username[/code]
| |
| | |
| after creating ftp users, give them passwords with [code]passwd username[/code]. the -d specifies the user’s home directory. i create symlinks in /ftphome/std/ to whatever directories i want to make accessible. the -s is the shell, and /sbin/nologin means that these users cannot login over ssh. i also created an ftp group with [code]groupadd -g ### ftpgroupname[/code] and put all my ftp-only users with that as the default group.
| |
| | |
| == web server (apache, mysql, php) ==
| |
| i do web development as a hobby, using apache httpd, php, and mysql. hecubus is my test web server, so it needs to be set up to be able to run php / mysql through apache.
| |
| | |
| requirements for running a web server are a moderate amount of disk space (a few hundred megabytes should do it) and a network card.
| |
| | |
| if you are also going to be installing mythtv, that’s going to require apache httpd, php, and mysql from yum and not from source. either way you can install all three from yum, start them, and set them to startup automatically with the following commands:
| |
| | |
| [code]# yum -y install httpd php mysql mysql-server php-mysql php-mbstring
| |
| # service httpd start
| |
| # service mysqld start
| |
| # chkconfig httpd on
| |
| # chkconfig mysqld on[/code]
| |
| | |
| if you go that route, ignore everything else here besides editing config files.
| |
| | |
| download the latest apache httpd server from [url=http://httpd.apache.org/download.cgi]apache.org[/url]. you want the unix source bz2 file. change directory to [code]/opt/src/[/code] (create it if it doesn’t exist) and extract the source with the following command:
| |
| | |
| [code]# tar xjvf /path/to/httpd-2.2.6.tar.bz2[/code]
| |
| | |
| change directory into the newly-created [code]httpd-2.2.6[/code] and run these commands to compile and install apache httpd server:
| |
| | |
| [code]$ ./configure --prefix=/etc/httpd --enable-module=rewrite --enable-shared=rewrite --enable-module=so
| |
| $ make
| |
| # make install[/code]
| |
| | |
| create an apache user:
| |
| | |
| [code]# useradd -g groupname -u 1## -s /dev/null -d /etc/httpd apache[/code]
| |
| | |
| now create the file [code]/etc/rc.d/init.d/httpd[/code] with the following text:
| |
| | |
| [code]#!/bin/sh
| |
| #
| |
| # Startup script for the Apache Web Server
| |
| #
| |
| # chkconfig: 345 85 15
| |
| # description: Apache is a World Wide Web server. It is used to serve \
| |
| # HTML files and CGI.
| |
| # processname: httpd
| |
| # pidfile: /var/run/httpd.pid
| |
| # config: /etc/httpd/conf/access.conf
| |
| # config: /etc/httpd/conf/httpd.conf
| |
| # config: /etc/httpd/conf/srm.conf
| |
| | |
| | |
| # Source function library.
| |
| . /etc/rc.d/init.d/functions
| |
| | |
| # See how we were called.
| |
| case "$1" in
| |
| start)
| |
| echo -n "Starting httpd: "
| |
| daemon /etc/httpd/bin/httpd
| |
| echo
| |
| touch /var/lock/subsys/httpd
| |
| ;;
| |
| stop)
| |
| echo -n "Shutting down http: "
| |
| killproc httpd
| |
| echo
| |
| rm -f /var/lock/subsys/httpd
| |
| rm -f /var/run/httpd.pid
| |
| ;;
| |
| status)
| |
| status httpd
| |
| ;;
| |
| restart)
| |
| $0 stop
| |
| $0 start
| |
| ;;
| |
| reload)
| |
| echo -n "Reloading httpd: "
| |
| killproc httpd -HUP
| |
| echo
| |
| ;;
| |
| *)
| |
| echo "Usage: $0 {start|stop|restart|reload|status}"
| |
| exit 1
| |
| esac
| |
| | |
| exit 0[/code]
| |
| | |
| make it executable, start the server, and make it start automatically:
| |
| | |
| [code]# chmod 755 /etc/rc.d/init.d/httpd
| |
| # service httpd start
| |
| # chkconfig --add httpd[/code]
| |
| | |
| if you need any special configuration, edit the config file at [code]/etc/httpd/conf/httpd.conf[/code]. i run multiple test sites under multiple ports so i need to do this, but it’s not always necessary. the default path for a yum install is [code]/var/www/html/[/code].
| |
| | |
| next open port(s) through the firewall. i limit port 80 to my lan but serve my other ports to the internet:
| |
| | |
| [code]-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -s 192.168.1.0/24 --dport 80 -j ACCEPT
| |
| -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80##:80## -j ACCEPT[/code]
| |
| | |
| [code]# service iptables restart[/code]
| |
| | |
| | |
| for mysql, create a user named mysql and allow it to use the default group mysql:
| |
| | |
| [code]# useradd -r mysql[/code]
| |
| | |
| the mysql website seems to be trying to get you to pay for mysql with professional support, but i’m not a business and just want to download the source. right now, source downloads can be found at [url=http://dev.mysql.com/downloads/mysql/5.0.html#source]this well-buried location[/url] — go with the compressed gnu tar archive. it will want you to register, but there’s a small “no thanks” link below that will let you choose a mirror to download from. once downloaded, change directory to [code]/opt/src/[/code] (create it if it doesn’t exist) and extract the archive:
| |
| | |
| [code]# tar xzvf /path/to/mysql-5.0.51.tar.gz[/code]
| |
| | |
| change to the [code]mysql-5.0.51[/code] directory it extracted to, then run the following to configure and install it (make sure to set your own password instead of rootuserpassword):
| |
| | |
| [code]$ ./configure --prefix=/etc/mysql
| |
| $ make
| |
| # make install[/code]
| |
| # cp support-files/my-small.cnf /etc/my.cnf
| |
| # cp support-files/mysql.server /etc/rc.d/init.d/mysqld
| |
| # chmod 755 /etc/rc.d/init.d/mysqld
| |
| # cd /etc/mysql/
| |
| # bin/mysql_install_db --user=mysql
| |
| # chgrp -R mysql .
| |
| # service mysqld start
| |
| # chkconfig --add mysqld
| |
| # cp bin/mysql /usr/bin/
| |
| # chmod 755 /usr/bin/mysql
| |
| $ mysql -u root
| |
| > update mysql.user set password=password('rootuserpassword') where user='root';
| |
| > delete from mysql.user where user='';
| |
| > flush privileges;
| |
| > exit[/code]
| |
| | |
| to enter mysql again (to create accounts for web sites, create databases) use [code]mysql -u root -p[/code] and exit with [code]exit[/code].
| |
| | |
| | |
| php’s gd library needs libjpeg, so download the jpegsrc package from [url=http://www.ijg.org/files/]ijg.org[/url]. run the following to install:
| |
| | |
| [code]# cd /opt/src/
| |
| # tar xzvf /path/to/jpegsrc.v6b.tar.gz
| |
| # cd jpeg-6b/
| |
| # ./configure --enable-shared
| |
| # make
| |
| # make install[/code]
| |
| | |
| gd also needs libpng, so download it from [url=http://sourceforge.net/project/showfiles.php?group_id=5624&package_id=5683]sourceforge[/url] — get the latest version source .bz2 file (not the one that says no-config). run the following to install:
| |
| | |
| [code]# cd /opt/src/
| |
| # tar xjvf /path/to/libpng-1.2.24.tar.bz2
| |
| # cd libpng-1.2.24/
| |
| # ./configure
| |
| # make
| |
| # make install[/code]
| |
| | |
| install the freetype headers (for gd) with the following command:
| |
| | |
| [code]# yum install freetype-devel[/code]
| |
| | |
| download the php source from [url=http://www.php.net/downloads.php]php.net[/url] — get the bz2 source code package. run the following to install:
| |
| | |
| [code]$ cd /opt/src/
| |
| $ tar xjvf /path/to/php-5.2.5.tar.bz2
| |
| $ cd php-5.2.5/
| |
| $ ./configure --with-apxs2=/etc/httpd/bin/apxs --with-mysql=/etc/mysql --with-mysqli=/etc/mysql/bin/mysql_config --with-gd --with-freetype-dir=/usr --with-jpeg-dir=/usr/local/lib --with-zlib-dir=/usr/local --enable-mbstring
| |
| $ make
| |
| # make install
| |
| # cp php.ini-dist /usr/local/lib/php.ini
| |
| # echo AddType application/x-httpd-php .php >> /etc/httpd/conf/httpd.conf
| |
| # service httpd restart[/code]
| |
| | |
| == web server (apache, mysql, php) from yum ==
| |
| add multibyte string support with yum -y install php-mbstring
| |
| | |
| == personal video recorder (mythtv) ==
| |
| add atrpms and freshrpms repositories:
| |
| | |
| [code]# cd /etc/yum.repos.d/
| |
| # wget http://wilsonet.com/mythtv/atrpms.repo
| |
| # rpm --import http://atrpms.net/RPM-GPG-KEY.atrpms
| |
| # wget http://wilsonet.com/mythtv/freshrpms.repo[/code]
| |
| | |
| edit atrpms.repo and change 2 places to fedora 7 version (see comments), then install mythtv from yum:
| |
| | |
| [code]# yum -y install mythtv-suite[/code]
| |
| | |
| install ivtv drivers (provided your tv card is supported). make sure to have run yum -y update and rebooted before this step:
| |
| | |
| [code]# yum -y install ivtv-firmware
| |
| # yum -y install ivtv-kmdl-`uname -r`[/code]
| |
| | |
| you may also want to install the ivtv package for utilities like ivtv-tune, but this is not required:
| |
| | |
| [code]# yum -y install ivtv[/code]
| |
| | |
| if tv card not installed, shut down, install, and start up. otherwise just reboot. verify that /dev/video exists, symlinked to /dev/video# (# is probably 0, but remember it in case it's not). test with the command cat /dev/video > /tmp/test_capture.mpg. let that run for a while, then stop it with ctrl-c. make sure you can play the file.
| |
| | |
| mysql should already be set up with a password set for the root user and also running as a service. the following lines are likely to improve mythtv database performance if you add them to /etc/my.cnf, but as i don't keep recordings in mythtv for longer than it takes to export them i don't bother:
| |
| | |
| [code]key_buffer = 16M
| |
| table_cache = 128
| |
| sort_buffer_size = 2M
| |
| myisam_sort_buffer_size = 8M
| |
| query_cache_size = 16M[/code]
| |
| | |
| restart the mysql service if you added those lines to make sure the changes take effect: service mysqld restart
| |
| | |
| set up the default mysql databases using the provided sql file:
| |
| | |
| [code]$ mysql -u root
| |
| > update mysql.user set password=password('rootuserpassword') where user='root';
| |
| > delete from mysql.user where user='';
| |
| > flush privileges;
| |
| > exit
| |
| $ mysql -u root -p < /usr/share/doc/mythtv-docs-0.20.2/database/mc.sql[/code]
| |
| | |
| log into the server in a kde session, and run [i]mythtv setup[/i] from [i]multimedia[/i] in the k menu. choose your language, then go through the options in order.
| |
| | |
| under [i]general[/i], the [i]host address backend setup[/i] defaults are fine except for the [i]directory to hold recordings[/i] (on the second screen), which i change to one of my secondary drives. on the global backend setup, make sure tv format (ntsc) and channel frequency table (us-cable) are correct. the default settings are fine again until you reach [i]job queue (host-specific)[/i]. i am going to set up user jobs to run nuvexport and convert my recordings to xvid, so i need to check the boxes to allow all 4 user jobs. you can also change the job queue start and end times if you don't want your server detecting commercials or encoding video whenever it feels like it. on the [i]job queue (job commands)[/i] screen, change user job #1 description to convert to xvid, and user job #1 command to nuvexport-xvid --input="%FILE%". you can also enter other user jobs if you want to convert to different formats or with different settings, but i do everything the same way.
| |
| | |
| under [i]capture cards[/i], choose [i]new capture card[/i] to set up your tuner card. for my card, i change card type to "mpeg-2 encoder card (pvr-x50, pvr-500)" and everything else defaults correctly. if your video device is not /dev/video0 though, make sure to change it.
| |
| | |
| under [i]video sources[/i], choose [i]new video source[/i]. give it whatever name you like (for example, "xyz cable"). in the us or canada, schedulesdirect can hook you up with tv listings for $20/year after a free 7-day trial. unfortunately i don't know of any free services. sign up for an account at schedulesdirect.org if you don't already have one, and set up your channels on their site. back in mythtv, enter your user id and password, then click retrieve lineups. your lineup should come into [i]data direct lineup[/i].
| |
| | |
| under [i]input[/i], you connect your tv card to the listings. find your tuner in the list. enter a display name if you like (i use "tv"). choose the video source you chose earlier, then click [i]fetch channels from listings source[/i].
| |
| | |
| under [i]channel editor[i], i edit each channel and change its name to the network it shows (i'd rather see nbc than wxxx).
| |
| | |
| from a shell, get your tv listings into the database, then start the mythtv server:
| |
| | |
| [code]$ mythfilldatabase
| |
| # service mythbackend start[/code]
| |
| | |
| run mythtv frontend from [i]multimedia[/i] under the k menu for some additional configuration. go to utilities / setup, setup, then general. hit next until you reach mythfilldatabase, and check the box for [i]automatically run mythfilldatabase[/i]. i set mine to run every day, and choose times when i know i'm not going to record anything (5 - 15). it's also nice to leave it checked to run at the suggested time.
| |
| | |
| under tv settings, recording profiles, choose your encoder, go to high quality and set the width (720) and height (480) on the second page.
| |
| | |
| under tv settings, recording priorities, select recording priorities. i set start early to 1 and end late to 3 to help catch the entire show if the channel is running a little early or late.
| |
| | |
| now make sure the mythtv server starts automatically:
| |
| | |
| # chkconfig mythbackend on
| |
| | |
| finally, make sure the convert to xvid job can actually run (install nuvexport):
| |
| | |
| # yum -y install id3lib
| |
| # rpm -Uvh http://forevermore.net/files/nuvexport/nuvexport-0.4-0.20071226.svn.noarch.rpm
| |
| | |
| edit /etc/nuvexportrc as root, and make it look like this (make sure to fill in a useful path):
| |
| | |
| [code]#
| |
| # nuvexportrc:
| |
| #
| |
| # This file contains the configuration for nuvexport, and should be installed
| |
| # as /etc/nuvexportrc. You can also copy this file to ~/.nuvexportrc, where
| |
| # nuvexport will look first, if you wish to create settings local to a
| |
| # specific user.
| |
| #
| |
| # I try to use this file to document all of the commandline options supported
| |
| # by nuvexport, but it is quite likely that a few slip through here and there
| |
| # unnoticed. Feel free to poke around in the code for add_arg() calls to see
| |
| # all of the available options.
| |
| #
| |
| | |
| #
| |
| # Anything placed within the <nuvexport> section will be interpreted
| |
| # as a global option. Use this section for options that don't relate
| |
| # specifically to any particular exporter.
| |
| #
| |
| <nuvexport>
| |
| | |
| #
| |
| # Set export_prog to ffmpeg, transcode or mencoder, depending on your
| |
| # preference of program for exports. This is equivalent to --ffmpeg,
| |
| # --transcode or --mencoder
| |
| #
| |
| export_prog=mencoder
| |
| | |
| #
| |
| # Any other parameters set in this file are equivalent to using the equivalent
| |
| # setting as a commandline option. For boolean options like --deinterlace
| |
| # (--nodeinterlace), use deinterlace=yes (or no, true or false) instead.
| |
| # Actual commandline options will override anything in this file.
| |
| #
| |
| | |
| #
| |
| # Preferred mode -- if you don't set this, nuvexport will ask you what you
| |
| # would like to do. Use --mode or any of the mode symlinks (like
| |
| # nuvexport-xvid) to override.
| |
| #
| |
| # mode=xvid
| |
| | |
| #
| |
| # Setting underscores to yes will convert whitespace in filenames to an
| |
| # underscore character (which some people seem to prefer)
| |
| #
| |
| underscores=no
| |
| | |
| #
| |
| # Setting require_cutlist to yes will tell nuvexport to show only those
| |
| # recordings that have a cutlist
| |
| #
| |
| # require_cutlist=no
| |
| | |
| #
| |
| # By default, nuvexport picks what it thinks is a good name for your file
| |
| # (doing its best to avoid printing "Untitled" into the filename). Setting
| |
| # name will let you change the output format of the filename generated by
| |
| # nuvexport. Even after this formatting, nuvexport will still do some basic
| |
| # replacements to make sure that illegal filename characters (eg. /\:*?<>|)
| |
| # are replaced with a dash (or " with a '). The following format variables
| |
| # are supported:
| |
| #
| |
| # %f -> full path to the filename
| |
| # %c -> the chanid of the show
| |
| # %a -> start time in YYYYMMDDHHMMSS format
| |
| # %b -> end time in YYYYMMDDHHMMSS format
| |
| # %t -> title (show name)
| |
| # %s -> subtitle (episode name)
| |
| # %h -> hostname where the file resides
| |
| # %m -> showtime in human-readable format (see --date below)
| |
| # %d -> description
| |
| # %% -> a % character
| |
| #
| |
| filename=%t - %a - %s
| |
| | |
| #
| |
| # By default, nuvexport uses an American-style date to represent showtimes in
| |
| # lists and filenames. Use --date to override that with the format of your
| |
| # choosing. See the UnixDate section `perldoc Date::Manip` for formatting
| |
| # options.
| |
| #
| |
| # date=%m/%d, %i:%M %p
| |
| | |
| #
| |
| # Nuvexport has the option to crop a percentage of the border of each recording
| |
| # in order to get rid of the unsightly edges of the tv signal. The default 2%
| |
| # approximates the overscan of an average TV, but you can alter this from 0 to
| |
| # 5% to fit your preferences. Please keep in mind that this amount is removed
| |
| # prior to making any aspect conversions like removing black bars from 4:3
| |
| # recordings to make a 16:9 export.
| |
| #
| |
| crop_pct = 0
| |
| | |
| #
| |
| # Alternatively, you can override the general crop_pct to crop a different
| |
| # amount from specific sides of the recording.
| |
| #
| |
| # crop_top = 2
| |
| # crop_right = 2
| |
| # crop_bottom = 2
| |
| # crop_left = 2
| |
| | |
| #
| |
| # You can also override the output aspect ratio. This is useful in combination
| |
| # with crop_top=12.5 and crop_bottom=12.5 to remove the black bars from the
| |
| # top/bottom of recordings broadcast in fake widescreen.
| |
| #
| |
| # out_aspect = 16:9
| |
| #
| |
| | |
| </nuvexport>
| |
| | |
| #
| |
| # The sections below work as above, with each more specific section overriding
| |
| # the more generic.
| |
| #
| |
| | |
| <generic>
| |
| | |
| #
| |
| # Default to export to the current directory
| |
| #
| |
| path = /path/to/xvidtv/
| |
| | |
| #
| |
| # Use the cutlist (not to be confused with the commercial flag list) when
| |
| # exporting.
| |
| #
| |
| use_cutlist = yes
| |
| | |
| #
| |
| # Tell mythcommflag to generate a cutlist from the commercial flags before
| |
| # exporting. Don't forget to enable use_cutlist above, too.
| |
| #
| |
| gencutlist = yes
| |
| | |
| #
| |
| # Contrary to popular belief, enabling multipass will not make your recordings
| |
| # look better. What it will do, however is guarantee that the bitrate you
| |
| # choose will be the average bitrate of your entire encode (meaning that your
| |
| # exports will end up being about the same size per-minute), and that you
| |
| # will receive the best overall quality for a files of the same size.
| |
| #
| |
| multipass = no
| |
| | |
| #
| |
| # Disabling noise reduction can speed up your exports dramatically, but at the
| |
| # expense of some quality. For your convenience, this is also aliased on
| |
| # the commandline as --denoise (or --nodenoise), as well as
| |
| # --noise_reduction.
| |
| #
| |
| noise_reduction = no
| |
| | |
| #
| |
| # Deinterlace the video so that it looks better on software players.
| |
| #
| |
| deinterlace = yes
| |
| | |
| #
| |
| # Crop about 2% from the border of the recording before encoding. This is done
| |
| # to get rid of part of the broadcast signal that is usually obscured by the
| |
| # tv's overscan.
| |
| #
| |
| crop = no
| |
| | |
| #
| |
| # You can create settings for each export module type. These are the
| |
| # second-most generic sections, and will only be reached if there are no
| |
| # matches in the full or generic module names.
| |
| #
| |
| # If you have a particularly dirty signal, you might want to try to disable
| |
| # fast_denoise (it's actually part of yuvdenoise, which both the ffmpeg
| |
| # and transcode exporters call). It can be almost twice as slow as the
| |
| # default "fast" normal noise reduction, but it considerably more effective.
| |
| # The latest version of yuvdenoise (which is called directly by the ffmpeg
| |
| # exporters) does not support this option, so it is ignored in that case.
| |
| #
| |
| fast_denoise = yes
| |
| | |
| #
| |
| # If nuvexport is having trouble detecting the *input* aspect ratio of your
| |
| # recordings (MythTV used to hard-code all software-encoded files as 1:1
| |
| # regardless of the true aspect), set this option to one of the following:
| |
| #
| |
| # force_aspect = [ 1:1 4:3 16:9 2.21:1 ]
| |
| | |
| </generic>
| |
| | |
| <ffmpeg>
| |
| #
| |
| # ffmpeg is almost twice as fast if you disable noise reduction
| |
| #
| |
| # noise_reduction = no
| |
| #
| |
| # By default, nuvexport's ffmpeg module lets ffmpeg handle deinterlacing.
| |
| # I've found that this provides the best results, but if you wish to let
| |
| # yuvdenoise do it instead, set deint_in_yuvdenoise to a true value.
| |
| #
| |
| # deint_in_yuvdenoise = no
| |
| #
| |
| </ffmpeg>
| |
| | |
| <transcode>
| |
| | |
| #
| |
| # Mythtranscode will always be used for nupplevideo recordings because
| |
| # transcode can't read them, but setting force_mythtranscode to yes will
| |
| # force nuvexport to call mythtranscode when using the transcode exporter for
| |
| # mpeg recordings, too. This may help problems that some people have been
| |
| # having with transcode not recognizing certain dvb recordings, as well as
| |
| # transcode not working properly on certain ivtv recordings.
| |
| #
| |
| force_mythtranscode = yes
| |
| | |
| #
| |
| # Setting both force_mythtranscode and mythtranscode_cutlist to yes will tell
| |
| # nuvexport to use mythtranscode's built-in cutlist functions, rather than
| |
| # having transcode use its own. I've found that the cutlists for a handful
| |
| # of ivtv recordings that do not work properly with transcode's internal
| |
| # cutlist handler.
| |
| #
| |
| mythtranscode_cutlist = yes
| |
| | |
| </transcode>
| |
| | |
| <mencoder>
| |
| </mencoder>
| |
| | |
| ################################################################################
| |
| | |
| #
| |
| # You can also create settings for generic export module names. These will
| |
| # only be overridden by full module names.
| |
| #
| |
| | |
| <XviD>
| |
| | |
| vbr = yes # Enable vbr to get the multipass/quantisation options
| |
| # (enabling multipass or quantisation automatically enables vbr)
| |
| multipass = no # You get either multipass or quantisation; multipass will override
| |
| quantisation = 5 # 4 through 6 is probably right... 1..31 are allowed (lower is better quality)
| |
| | |
| a_bitrate = 96 # Audio bitrate of 128 kbps
| |
| v_bitrate = 750 # Remember, quantisation overrides video bitrate
| |
| | |
| width = 720 # Height adjusts automatically to width, according to aspect ratio
| |
| height = 480
| |
| | |
| </XviD>
| |
| | |
| #
| |
| # The mp3 bitrate used by MythTV's software encoder is 128, so there is no
| |
| # real need to go any higher in exports. You can, of course, turn this up if
| |
| # you get your recordings from other sources.
| |
| #
| |
| <MP3>
| |
| bitrate = 96
| |
| </MP3>
| |
| | |
| ################################################################################
| |
| | |
| #
| |
| # If you want to provide settings for a very specific export module, you can
| |
| # use its full name, and it will override any more generic settings.
| |
| #
| |
| | |
| #
| |
| # The MP4 encoder for ffmpeg has a few options unique to itself
| |
| #
| |
| <ffmpeg::MP4>
| |
| | |
| #
| |
| # Codec to use (mpeg4 or h264). Please note that h264 support requires the
| |
| # SVN version of ffmpeg (not CVS!). In fact, even the mpeg4 codec works
| |
| # better with the SVN version.
| |
| #
| |
| # Note: The h.264 files exported by nuvexport seem to play fine on ipods,
| |
| # but lack the atom necessary to be recognized by iTunes, so you will have to
| |
| # find other means to get the exports onto your ipod (gtkpod works great).
| |
| #
| |
| mp4_codec = h264
| |
| | |
| #
| |
| # Framerate to use: auto, 25, 23.97, 29.97. PAL will always be 25 fps, and
| |
| # auto will set 29.97 for everything over 320x288 and 23.97 for the rest.
| |
| #
| |
| mp4_fps = auto
| |
| | |
| #
| |
| # Enable ipod compatibility mode. Aside from forcing a max resolution of
| |
| # 640x480, this basically just sets motion detection reference frames (-refs)
| |
| # to 2 instead of 7 (the ipod can only handle 2), and thus a small drop in
| |
| # motion detection quality.
| |
| #
| |
| ipod = yes
| |
| | |
| </ffmpeg::MP4>
| |
| | |
| #
| |
| # As does the PSP exporter
| |
| #
| |
| <ffmpeg::PSP>
| |
| | |
| # PSP framerate (high=29.97, low=14.985)
| |
| psp_fps = low
| |
| | |
| # PSP resolution (320x240, 368x208 or 400x192)
| |
| psp_resolution = 320x240
| |
| | |
| # PSP video bitrate (high=768, low=384)
| |
| psp_bitrate = high
| |
| | |
| # Create a thumbnail to go with the PSP video export?
| |
| psp_thumbnail = yes
| |
| | |
| </ffmpeg::PSP>
| |
| | |
| #
| |
| # You can also add flags to the one and only mencoder option
| |
| #
| |
| <mencoder::XviD>
| |
| | |
| multipass = no
| |
| | |
| </mencoder::XviD>
| |
| | |
| ################################################################################
| |
| | |
| #
| |
| # You can also make specific profiles called with the --profile parameter that
| |
| # will override other config options (but not commandline arguments).
| |
| #
| |
| # For example, you could make a profile that would encode your favorite show
| |
| # with your favorite settings.
| |
| #
| |
| <profile::sample>
| |
| | |
| title = test
| |
| | |
| export_prog = transcode
| |
| mode = xvid
| |
| confirm = true
| |
| | |
| </profile::sample>
| |
| | |
| #
| |
| # Or crop the black bars off of the top/bottom of fake widescreen shows.
| |
| #
| |
| <profile::samplewide>
| |
| | |
| title = test
| |
| | |
| export_prog = ffmpeg
| |
| mode = mp4
| |
| | |
| out_aspect = 16:9
| |
| | |
| crop_pct = 0
| |
| crop_top = 12.5
| |
| crop_bottom = 12.5
| |
| | |
| width = 528
| |
| height = 360
| |
| | |
| </profile::samplewide>[/code]
| |
| | |
| since i don't plan on logging into my server for x sessions, i use mythweb (installed to /var/www/html/mythweb/) to schedule recordings. access it from http://yourserver/mythweb/. to record something and have it automatically convert to xvid, first find the show either through browsing the listings from the link in the upper left, or using the search box in the upper right. click on the link for the show and choose whichever schedule option works best for you. under advanced options change recording profile to high quality, uncheck auto-transcode, and check convert to xvid. click update recording settings and your show will be scheduled.
| |