mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
20141229-1 选题
This commit is contained in:
parent
bf911bde6c
commit
56bad99e54
@ -0,0 +1,125 @@
|
||||
4 Steps to Setup Local Repository in Ubuntu using APT-mirror
|
||||
================================================================================
|
||||
Today we will show you how to setup a local repository in your Ubuntu PC or Ubuntu Server straight from the official Ubuntu repository. There are a lot benefit of creating a local repository in your computer if you have a lot of computers to install software, security updates and fixes often in all systems, then having a local Ubuntu repository is an efficient way. Because all required packages are downloaded over the fast LAN connection from your local server, so that it will save your Internet bandwidth and reduces the annual cost of Internet..
|
||||
|
||||
You can setup a local repository of Ubuntu in your local PC or server using many tools, but we'll featuring about APT-Mirror in this tutorial. Here, we'll be mirroring packages from the default mirror to our Local Server or PC and we'll need at least **120 GB** or more free space in your local or external hard drive. It can be configured through a **HTTP** or **FTP** server to share its software packages with local system clients.
|
||||
|
||||
We'll need to install Apache Web Server and APT-Mirror to get our stuffs working out of the box. Here are the steps below to configure a working local repository:
|
||||
|
||||
### 1. Installing Required Packages ###
|
||||
|
||||
First of all, we are going to pull whole packages from the public repository of Ubuntu package server and save them in our local Ubuntu server hard disk.
|
||||
|
||||
We'll first install a web server to host our local repository. We'll install Apache web server but you can install any web server you wish, web server are necessary for the http protocol. You can additionally install FTP servers like proftpd, vsftpd,etc if you need to configure for ftp protocols and Rsync for rsync protocols.
|
||||
|
||||
$ sudo apt-get install apache2
|
||||
|
||||
And then we'll need to install apt-mirror:
|
||||
|
||||
$ sudo apt-get install apt-mirror
|
||||
|
||||
![apt-mirror-installation](http://blog.linoxide.com/wp-content/uploads/2014/12/apt-mirror-install.png)
|
||||
|
||||
**Note: As I have already mentioned that we'll need at least 120 GBs free space to get all the packages mirrored or download.**
|
||||
|
||||
### 2. Configuring APT-Mirror ###
|
||||
|
||||
Now create a directory on your harddisk to save all packages. For example, let us create a directory called “/linoxide”. We are going to save all packages in this directory:
|
||||
|
||||
$ sudo mkdir /linoxide
|
||||
|
||||
![repo-dir](http://blog.linoxide.com/wp-content/uploads/2014/12/mkdir-linoxide.png)
|
||||
|
||||
Now, open the file **/etc/apt/mirror.list** file
|
||||
|
||||
$ sudo nano /etc/apt/mirror.list
|
||||
|
||||
![apt-mirror-edit](http://blog.linoxide.com/wp-content/uploads/2014/12/edit-mirror-list-300x7.png)
|
||||
|
||||
Copy the below lines of configuration to mirror.list and edit as your requirements.
|
||||
|
||||
############# config ##################
|
||||
#
|
||||
set base_path /linoxide
|
||||
#
|
||||
# set mirror_path $base_path/mirror
|
||||
# set skel_path $base_path/skel
|
||||
# set var_path $base_path/var
|
||||
# set cleanscript $var_path/clean.sh
|
||||
# set defaultarch <running host architecture>
|
||||
# set postmirror_script $var_path/postmirror.sh
|
||||
# set run_postmirror 0
|
||||
set nthreads 20
|
||||
set _tilde 0
|
||||
#
|
||||
############# end config ##############
|
||||
|
||||
deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
|
||||
deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
|
||||
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
|
||||
#deb http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse
|
||||
#deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
|
||||
|
||||
deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
|
||||
deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
|
||||
deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
|
||||
#deb-src http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse
|
||||
#deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
|
||||
|
||||
clean http://archive.ubuntu.com/ubuntu
|
||||
|
||||
![mirror-list-config](http://blog.linoxide.com/wp-content/uploads/2014/12/mirror-list-config.png)
|
||||
|
||||
**Note: You can replace the above official mirror server url by the nearest one, you can get your nearest server by visiting the page [Ubuntu Mirror Server][1]. If you are not in hurry and can wait for the mirroring, you can go with the default official one.**
|
||||
|
||||
Here, we are going to mirror package repository of the latest and greatest LTS release of Ubuntu ie. Ubuntu 14.04 LTS (Trusty Tahr) so, we have configured trusty. If you need to mirror of Saucy or other version of Ubuntu, please edit it as its codename.
|
||||
|
||||
Now, we'll have to run apt-mirror which will now get/mirror all the packages in the repository.
|
||||
|
||||
sudo apt-mirror
|
||||
|
||||
It will take time to download all the packages from the Ubuntu Server which depends upon the connection speed and performance with respect to you and the mirror server. I have interrupted the download as I have already done that...
|
||||
|
||||
![downloading-packages](http://blog.linoxide.com/wp-content/uploads/2014/12/downloading-index.png)
|
||||
|
||||
### 3.Configuring Web Server ###
|
||||
|
||||
To be able to access the repo from other computers you need a webserver. You can also do it via ftp but I choose to use a webserver as I mentioned in above step 1. So, we are now gonna configure Apache Server:
|
||||
|
||||
We will create a symlink from our local repo's directory to a directory ubuntu in the hosting directory of Apache ie /var/www/ubuntu
|
||||
|
||||
$ sudo ln -s /linoxide /var/www/ubuntu
|
||||
$ sudo service apache2 start
|
||||
|
||||
![symlinks-apache2](http://blog.linoxide.com/wp-content/uploads/2014/12/symblink-apache2.png)
|
||||
|
||||
The above command will allow us to browse our Mirrored Repo from our localhost ie http://127.0.0.1 by default.
|
||||
|
||||
### 4. Configuring Client Side ###
|
||||
|
||||
Finally, we need to add repository source in other computers which will fetch the packages and repository from our computer. To do that, we'll need to edit /etc/apt/sources.list and add the following lines.
|
||||
|
||||
$ sudo nano /etc/apt/sources.list
|
||||
|
||||
Add this line in /etc/apt/sources.list and save.
|
||||
|
||||
deb http://192.168.0.100/ubuntu/ trusty main restricted universe
|
||||
|
||||
**Note: here 192.168.0.100 is the LAN IP address of our server computer, you need to replace that with yours.**
|
||||
|
||||
$ sudo apt-get update
|
||||
|
||||
Finally, we are done. Now you can install the required packages using sudo apt-get install packagename from your local Ubuntu repository with high speed download and with low bandwidth.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/ubuntu-how-to/setup-local-repository-ubuntu/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
||||
[1]:https://launchpad.net/ubuntu/+archivemirrors
|
264
sources/tech/20141229 5 User Space Debugging Tools in Linux.md
Normal file
264
sources/tech/20141229 5 User Space Debugging Tools in Linux.md
Normal file
@ -0,0 +1,264 @@
|
||||
5 User Space Debugging Tools in Linux
|
||||
================================================================================
|
||||
By definition, debugging tools are those programs which allow us to monitor ,control and correct errors in other programs while they execute. Why should we use debugging tools? To answer this, there are various situations where we get stuck while running some programs and will have the need to understand what exactly happened. For example, we might be running an application and it produces some error messages. To fix those errors, we should first figure out why and from where did the error messages come from. An application might suddenly hang and we will have to know what other processes were running at that time. We might also have to figure out what was process 'x' doing at the time of hang. In order to dissect such details, we will need the help of debugging tools. There are a few user space debugging tools and techniques in Linux which are quite useful in analysing user space problems. They are:
|
||||
|
||||
- **'print' statements**
|
||||
- **Querying (/proc, /sys etc)**
|
||||
- **Tracing (strace/ltrace)**
|
||||
- **Valgrind (memwatch)**
|
||||
- **GDB**
|
||||
|
||||
Let's go through each of them one by one.
|
||||
|
||||
### 1.'print' statements ###
|
||||
|
||||
This is a basic or primitive way of debugging a problem. We can insert print statements in the middle of a program to understand the control flow and get the value of key variables. Though it is a simple technique, it has some disadvantages to it. Programs need to be edited to add 'print 'statements which then will have to be recompiled and rerun to get the output. This is a time-consuming method if the program to be debugged is quite big.
|
||||
|
||||
### 2. Querying ###
|
||||
|
||||
In some situations, we might want to figure out in what state a running process is in the kernel or what is the memory map that it is occupying there etc. In order to obtain this type of information, we need not insert any code into the kernel. Instead, one can use the /proc filesystem.
|
||||
|
||||
/proc is a pseudo filesystem that gets populated with runtime system information (cpu information, amount of memory etc) once the system is up and running.
|
||||
|
||||
![output of 'ls /proc'](http://blog.linoxide.com/wp-content/uploads/2014/12/proc-output.png)
|
||||
output of 'ls /proc'
|
||||
|
||||
As you can see, each process that is running in the system has an entry in the /proc filesystem in the form of its process id . Details about each of these processes can be obtained by looking into the files present in its process id directory
|
||||
|
||||
![output of 'ls /proc/pid'](http://blog.linoxide.com/wp-content/uploads/2014/12/proc-pid.png)
|
||||
output of 'ls /proc/pid'
|
||||
|
||||
Explaining all the entries inside the /proc filesystem is beyond the scope of this document. Some of the useful ones are listed below:
|
||||
|
||||
- /proc/cmdline -> Kernel command line
|
||||
- /proc/cpuinfo -> information about the processor's make, model etc
|
||||
- /proc/filesystems -> filesystem information supported by the kernel
|
||||
- /proc//cmdline -> command line arguments passed to the current process
|
||||
- /proc//mem -> memory held by the process
|
||||
- /proc//status -> status of the process
|
||||
|
||||
### 3. Tracing ###
|
||||
|
||||
strace and ltrace are two of the tracing tools used in Linux to trace program execution details.
|
||||
|
||||
#### strace: ####
|
||||
|
||||
strace intercepts and records system calls within a process and the signals received by it. To the user, it displays the system calls, arguments passed to them and the return values. strace can be attached to a process that is already running or to a new process. It is useful as a diagnostic and debugging tools for developers and system administrators. It can also be used as a tool to understand how system calls work by tracing different programs. Advantage of this tool is that no source code is needed and programs need not be recompiled.
|
||||
|
||||
The basic syntax for using strace is:
|
||||
|
||||
**strace command**
|
||||
|
||||
There are various options that are available to be used with strace command. One can check out the man page for strace tool to get more details.
|
||||
|
||||
The output of strace can be quite lengthy and we may not be interested in going through each and every line that is displayed. We can use the '-e expr' option to filter the unwanted data.
|
||||
|
||||
Use '-p pid' option to attach it to a running process.
|
||||
|
||||
Output of the command can be redirected to a file using the '-o' option
|
||||
|
||||
![output of strace filtering only the open system call](http://blog.linoxide.com/wp-content/uploads/2014/12/strace-output.png)
|
||||
output of strace filtering only the open system call
|
||||
|
||||
#### ltrace: ####
|
||||
|
||||
ltrace tracks and records the dynamic (runtime) library calls made by a process and the signals received by it. It can also track the system calls made within a process. It's usage is similar to strace
|
||||
|
||||
**ltrace command**
|
||||
|
||||
'-i ' option prints the instruction pointer at the time of library call
|
||||
|
||||
'-S' option is used to display both system calls and library calls
|
||||
|
||||
Refer to the ltrace man page for all the available options.
|
||||
|
||||
![output of ltrace capturing 'strcmp' library call](http://blog.linoxide.com/wp-content/uploads/2014/12/ltrace-output.png)
|
||||
output of ltrace capturing 'strcmp' library call
|
||||
|
||||
### 4. Valgrind ###
|
||||
|
||||
Valgrind is a suite of debugging and profiling tools. One of the widely used and the default tool is a memory checking tool called 'Memcheck' which intercepts calls made to malloc(), new(), free() and delete(). In other words, it is useful in detecting problems like:
|
||||
|
||||
- memory leaks
|
||||
- double freeing
|
||||
- boundary overruns
|
||||
- using uninitialized memory
|
||||
- using a memory after it has been freed etc.
|
||||
|
||||
It works directly with the executable files.
|
||||
|
||||
Valgrind comes with a few drawbacks as well. It can slow down your program as it increases the memory footprint. It can sometimes produce false positives and false negatives. It cannot detect out-of-range access to statically allocated arrays
|
||||
|
||||
In order to use it, first download it and install it on your system. ([Valgrind's download page][1]). It can be installed using the package manager for the operating system that one is using.
|
||||
|
||||
Installation using command line involves decompressing and untarring the downloaded file.
|
||||
|
||||
tar -xjvf valgring-x.y.z.tar.bz2 (where x.y.z is the version number you are trying to install)
|
||||
|
||||
Get inside the newly created directory (valgrind-x.y.z)and run the following commands:
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
Let's understand how valgrind works with a small program(test.c):
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void f(void)
|
||||
|
||||
{
|
||||
int x = malloc(10 * sizeof(int));
|
||||
|
||||
x[10] = 0;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
f();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Compile the program:
|
||||
|
||||
gcc -o test -g test.c
|
||||
|
||||
Now we have an executable file called 'test'. We can now use valgrind to check for memory errors:
|
||||
|
||||
valgrind –tool=memcheck –leak-check=yes test
|
||||
|
||||
Here is the valgrind output showing the errors:
|
||||
|
||||
![output of valgrind showing heap block overrun and memory leak](http://blog.linoxide.com/wp-content/uploads/2014/12/Valgrind.png)
|
||||
output of valgrind showing heap block overrun and memory leak
|
||||
|
||||
As we can see in the above message, we are trying to access the area beyond what is allocated in function f and the allocated memory is not freed.
|
||||
|
||||
### 5. GDB ###
|
||||
|
||||
GDB is a debugger from Free Software Foundation. It is useful in locating and fixing problems in the code. It gives control to the user to perform various actions when the program to be debugged is running, like:
|
||||
|
||||
- starting the program
|
||||
- stop at specified locations
|
||||
- stop on specified conditions
|
||||
- examine required information
|
||||
- make changes to data in the program etc.
|
||||
|
||||
One can also attach a core dump of a crashed program to GDB and analyse the cause of crash.
|
||||
|
||||
GDB provides a lot of options to debug programs. However, we will cover some important options here so that one can get a feel of how to get started with GDB.
|
||||
|
||||
If you do not already have GDB installed, it can be downloaded from [GDB's official website][2].
|
||||
|
||||
#### Compiling programs: ####
|
||||
|
||||
In order to debug a program using GDB, it has to be compiled using gcc with the'-g' option. This produces debugging information in the operating system's native format and GDB works with this information.
|
||||
|
||||
Here is a simple program (example1.c)performing divide by zero to show the usage of GDB:
|
||||
|
||||
#include
|
||||
int divide()
|
||||
{
|
||||
int x=5, y=0;
|
||||
return x / y;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
divide();
|
||||
}
|
||||
|
||||
![An example showing usage of gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb-example.png)
|
||||
An example showing usage of gdb
|
||||
|
||||
#### Invoking GDB: ####
|
||||
|
||||
GDB can be started by executing 'gdb' in the command-line:
|
||||
|
||||
![invoking gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb.png)
|
||||
invoking gdb
|
||||
|
||||
Once invoked, it remains there waiting for commands from the terminal and executing them until exited .
|
||||
|
||||
If a process is already running and you need to attach GDB to it, it can be done by specifying the process id Suppose a program has already crashed and one wants to analyse the cause of the problem, then attaching GDB to the core file helps.
|
||||
|
||||
#### Starting the program: ####
|
||||
|
||||
Once you are inside GDB, use the 'run' command to start the program to be debugged
|
||||
|
||||
#### Passing arguments to the program: ####
|
||||
|
||||
Use the 'set args' command to send the arguments to your program when it runs next time 'show args' will show the arguments passed to the program
|
||||
|
||||
#### Verifying the stack: ####
|
||||
|
||||
Whenever a program stops, first thing anyone wants to understand is why it stopped and how it stopped there. This information is called backtrace. Every function call generated by a program gets stored along with the local variables, arguments passed, call location etc in a block of data inside the stack and is called a frame. Using GDB we can examine all this data. GDB identifies these frames by giving them numbers starting from the innermost frame.
|
||||
|
||||
- **bt**: prints the backtrace of the entire stack
|
||||
- **bt <n>** prints the backtrace of n frames
|
||||
- **frame <frame number>**: switches to the specified frame and prints that frame
|
||||
- **up <n>**: move 'n' frames up
|
||||
- **down <n>**: move 'n' frames down. ( n is 1 by default)
|
||||
|
||||
#### Examining data: ####
|
||||
|
||||
Program's data can be examined inside GDB using the 'print' command. For example, if 'x' is a variable inside the debugging program, 'print x' prints the value of x.
|
||||
|
||||
#### Examining source: ####
|
||||
|
||||
Parts of source file can be printed within GDB. 'list' command by default prints 10 lines of code.
|
||||
|
||||
- **list <linenum>**: list the source file around 'linenum'
|
||||
- **list <function>**: list the source from the beginning of 'function'
|
||||
|
||||
- **disas <function>**: displays the machine code for the function
|
||||
|
||||
#### Stopping and resuming the program: ####
|
||||
|
||||
Using GDB, we can set breakpoints, watchpoint etc in order to stop the program wherever required.
|
||||
|
||||
- **break <location>**: Sets up a breakpoint at 'location'. When this is hit while the program is executing, control is given to the user.
|
||||
- **watch <expr>**: GDB stops when the 'expr' is written into by the program and it's value changes
|
||||
- **catch <event>**: GDB stops when the 'event' occurs.
|
||||
- **disable <breakpoint>**: disable the specified breakpoint
|
||||
- **enable <breakpoint>**: enable the specified breakpoint
|
||||
- **delete <breakpoint>**: delete the breakpoint / watchpoint / catch point passed. If no arguments are passed default action is to work on all the breakpoints
|
||||
|
||||
- **step**: execute the program step by step
|
||||
- **continue**: continue with program execution until execution is complete
|
||||
|
||||
#### Exiting GDB: ####
|
||||
|
||||
Use the 'quit' command to exit from GDB
|
||||
|
||||
There are many more options that are available with GDB. Use the help option once you are inside GDB for more details.
|
||||
|
||||
![getting help within gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb-help.png)
|
||||
getting help within gdb
|
||||
|
||||
### Summary ###
|
||||
|
||||
In this article, we have seen different types of user space debug tools available in Linux. To summarise all of them, here is a quick guideline on when to use what:
|
||||
Basic debugging, getting values of key variables – print statements
|
||||
|
||||
Get information about filesystems supported, available memory, cpus, status of a running program in the kernel etc - querying /proc filesystem
|
||||
|
||||
Initial problem diagnosis, system call or library call related issues , understanding program flow – strace / ltrace
|
||||
|
||||
Application space related memory problems – valgrind
|
||||
|
||||
To examine runtime behaviour of applications, analysing application crashes – gdb.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-how-to/user-space-debugging-tools-linux/
|
||||
|
||||
作者:[B N Poornima][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/bnpoornima/
|
||||
[1]:http://valgrind.org/downloads.html
|
||||
[2]:http://www.gnu.org/software/gdb/download/
|
@ -0,0 +1,83 @@
|
||||
How to Create Btrfs Filesystem in Linux and its Features
|
||||
================================================================================
|
||||
**Btrfs** (B-tree file system) is a new CoW (copy-on-write) file system for Linux. It's development began at [Oracle Corporation][1] in 2007 and it was marked as stable in August 2014. The purpose of Btrfs is to address the lack of pooling, snapshots, checksums, and integral multi-device spanning in Linux file systems and its goal was to let Linux scale for the storage that will be available. Scaling is not just about addressing the storage but also means being able to administer and to manage it with a clean interface that lets people see what's being used and makes it more reliable.
|
||||
|
||||
You should note that Btrfs has just become stable so it is recommended to always use the latest available version of the kernel to avoid any problems or bugs.
|
||||
|
||||
### Btrfs Features ###
|
||||
|
||||
Among the most important features of the new file system:
|
||||
|
||||
- Extent based file storage
|
||||
- 16 EiB maximum file size
|
||||
- Space-efficient packing of small files and indexed directories
|
||||
- Dynamic inode allocation
|
||||
- Writable snapshots and read-only snapshots
|
||||
- Subvolumes (separate internal filesystem roots)
|
||||
- Checksums on data and metadata
|
||||
- Compression (gzip and LZO)
|
||||
- Integrated multiple device support
|
||||
- File Striping, File Mirroring, and File Striping+Mirroring implementations
|
||||
- Efficient incremental backup
|
||||
- Background scrub process for finding and fixing errors on files with redundant copies
|
||||
- Online filesystem defragmentation and Offline filesystem check
|
||||
- Btrfs filesystem have much enhancement on RAID 5/ RAID 6 support and many [bug fixes has been added on linux 3.19][2]
|
||||
|
||||
You can [read about the new features][3] on this wiki article covering the subject.
|
||||
|
||||
### Converting to Btrfs ###
|
||||
|
||||
**WARNING: You should always backup your data before atempting to convert a file system. Although this operation is stable and safe it can lead to data loss and the only way to prevent this is to always have a backup of your data.**
|
||||
|
||||
Converting an existing ext4 filesystem to btrfs is quite simple and straightforward, you will first need to use fsck to check if there are any errors on your existing partition and then use the btrfs-convert command to convert it. If the partition you wish to convert is /dev/sda3 you can do it like this:
|
||||
|
||||
# fsck.ext4 /dev/sda4
|
||||
# btrfs-convert /dev/sda4
|
||||
|
||||
You can then use the mount command to mount it where you wish.
|
||||
|
||||
![btrfs-convert](http://blog.linoxide.com/wp-content/uploads/2014/11/btrfs-convert.jpg)
|
||||
|
||||
### Converting the root partition ###
|
||||
|
||||
If you wish to convert the root partition of your system you will first have to boot a live CD, you can do this by using the Ubuntu installation CD and selecting "Try Ubuntu" from the first screen or use any other Live CD image available.
|
||||
|
||||
After you boot open a terminal and use it to convert the filesystem.
|
||||
|
||||
# fsck.ext4 /dev/sda1
|
||||
# btrfs-convert /dev/sda1
|
||||
|
||||
Next chroot to the filesystem so you can change fstab and reinstall grub
|
||||
|
||||
# mount /dev/sda1 /mnt
|
||||
# for i in dev dev/pts proc sys ; do mount --bind /$i /mnt/$i ; done
|
||||
# chroot /mnt
|
||||
# blkid | grep sda1
|
||||
|
||||
![btrfs-root-convert](http://blog.linoxide.com/wp-content/uploads/2014/11/btrfs-root-convert.jpg)
|
||||
|
||||
Now edit fstab and replace the current UUID of the / filesystem with the one blkid outputted and the filesystem type with btrfs, the new line should look like this:
|
||||
|
||||
UUID=8e7e80aa-337e-4179-966d-d60128bd3714 / btrfs defaults 0 1
|
||||
|
||||
Then reinstall Grub:
|
||||
|
||||
# grub-install /dev/sda
|
||||
# update-grub
|
||||
|
||||
You can now reboot the machine without using the boot CD and use it with the new filesystem.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/file-system/create-btrfs-features/
|
||||
|
||||
作者:[Adrian Dinu][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/adriand/
|
||||
[1]:http://www.oracle.com/index.html
|
||||
[2]:http://lkml.iu.edu/hypermail/linux/kernel/1412.1/03583.html
|
||||
[3]:https://btrfs.wiki.kernel.org/index.php/Main_Page#Features
|
@ -0,0 +1,202 @@
|
||||
How to Install Bugzilla 4.4 on Ubuntu / CentOS 6.x
|
||||
================================================================================
|
||||
Here, we are gonna show you how we can install Bugzilla in an Ubuntu 14.04 or CentOS 6.5/7. Bugzilla is a Free and Open Source Software(FOSS) which is web based bug tracking tool used to log and track defect database, its Bug-tracking systems allow individual or groups of developers effectively to keep track of outstanding problems with their product. Despite being "free", Bugzilla has many features its expensive counterparts lack. Consequently, Bugzilla has quickly become a favorite of thousands of organizations across the globe.
|
||||
|
||||
Bugzilla is very adaptable to various situations. They are used now a days in different IT support queues, Systems Administration deployment management, chip design and development problem tracking (both pre-and-post fabrication), and software and hardware bug tracking for luminaries such as Redhat, NASA, Linux-Mandrake, and VA Systems.
|
||||
|
||||
### 1. Installing dependencies ###
|
||||
|
||||
Setting up Bugzilla is fairly **easy**. This blog is specific to Ubuntu 14.04 and CentOS 6.5 ( though it might work with older versions too )
|
||||
|
||||
In order to get Bugzilla up and running in Ubuntu or CentOS, we are going to install Apache webserver ( SSL enabled ) , MySQL database server and also some tools that are required to install and configure Bugzilla.
|
||||
|
||||
To install Bugzilla in your server, you'll need to have the following components installed:
|
||||
|
||||
- Per l(5.8.1 or above)
|
||||
- MySQL
|
||||
- Apache2
|
||||
- Bugzilla
|
||||
- Perl modules
|
||||
- Bugzilla using apache
|
||||
|
||||
As we have mentioned that this article explains installation of both Ubuntu 14.04 and CentOS 6.5/7, we will have 2 different sections for them.
|
||||
|
||||
Here are the steps you need to follow to setup Bugzilla in your Ubuntu 14.04 LTS and CentOS 7:
|
||||
|
||||
**Preparing the required dependency packages:**
|
||||
|
||||
You need to install the essential packages by running the following command:
|
||||
|
||||
**For Ubuntu:**
|
||||
|
||||
$ sudo apt-get install apache2 mysql-server libapache2-mod-perl2
|
||||
libapache2-mod-perl2-dev libapache2-mod-perl2-doc perl postfix make gcc g++
|
||||
|
||||
**For CentOS:**
|
||||
|
||||
$ sudo yum install httpd mod_ssl mysql-server mysql php-mysql gcc perl* mod_perl-devel
|
||||
|
||||
**Note: Please run all the commands in a shell or terminal and make sure you have root access (sudo) on the machine.**
|
||||
|
||||
### 2. Running Apache server ###
|
||||
|
||||
As you have already installed the apache server from the above step, we need to now configure apache server and run it. We'll need to go for sudo or root mode to get all the commands working so, we'll gonna switch to root access.
|
||||
|
||||
$ sudo -s
|
||||
|
||||
Now, we need to open port 80 in the firewall and need to save the changes.
|
||||
|
||||
# iptables -I INPUT -p tcp --dport 80 -j ACCEPT
|
||||
# service iptables save
|
||||
|
||||
Now, we need to run the service:
|
||||
|
||||
For CentOS:
|
||||
|
||||
# service httpd start
|
||||
|
||||
Lets make sure that Apache will restart every time you restart the machine:
|
||||
|
||||
# /sbin/chkconfig httpd on
|
||||
|
||||
For Ubuntu:
|
||||
|
||||
# service apache2 start
|
||||
|
||||
Now, as we have started our apache http server, we will be able to open apache server at IP address of 127.0.0.1 by default.
|
||||
|
||||
### 3. Configuring MySQL Server ###
|
||||
|
||||
Now, we need to start our MySQL server:
|
||||
|
||||
For CentOS:
|
||||
|
||||
# chkconfig mysqld on
|
||||
# service start mysqld
|
||||
|
||||
For Ubuntu:
|
||||
|
||||
# service mysql-server start
|
||||
|
||||
![mysql](http://blog.linoxide.com/wp-content/uploads/2014/12/mysql.png)
|
||||
|
||||
Login with root access to MySQL and create a DB for Bugzilla. Change “mypassword” to anything you want for your mysql password. You will need it later when configuring Bugzilla too.
|
||||
|
||||
For Both CentOS 6.5 and Ubuntu 14.04 Trusty
|
||||
|
||||
# mysql -u root -p
|
||||
|
||||
# password: (You'll need to enter your password)
|
||||
|
||||
# mysql > create database bugs;
|
||||
|
||||
# mysql > grant all on bugs.* to root@localhost identified by "mypassword";
|
||||
|
||||
#mysql > quit
|
||||
|
||||
**Note: Please remember the DB name, passwords for mysql , we'll need it later.**
|
||||
|
||||
### 4. Installing and configuring Bugzilla ###
|
||||
|
||||
Now, as we have all the required packages set and running, we'll want to configure our Bugzilla.
|
||||
|
||||
So, first we'll want to download the latest Bugzilla package, here I am downloading version 4.5.2 .
|
||||
|
||||
To download using wget in a shell or terminal:
|
||||
|
||||
wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-4.5.2.tar.gz
|
||||
|
||||
You can also download from their official site ie. [http://www.bugzilla.org/download/][1]
|
||||
|
||||
**Extracting and renaming the downloaded bugzilla tarball:**
|
||||
|
||||
# tar zxvf bugzilla-4.5.2.tar.gz -C /var/www/html/
|
||||
|
||||
# cd /var/www/html/
|
||||
|
||||
# mv -v bugzilla-4.5.2 bugzilla
|
||||
|
||||
|
||||
|
||||
**Note**: Here, **/var/www/html/bugzilla/** is the directory where we're gonna **host Bugzilla**.
|
||||
|
||||
Now, we'll configure buzilla:
|
||||
|
||||
# cd /var/www/html/bugzilla/
|
||||
|
||||
# ./checksetup.pl --check-modules
|
||||
|
||||
![bugzilla-check-module](http://blog.linoxide.com/wp-content/uploads/2014/12/bugzilla2-300x198.png)
|
||||
|
||||
After the check is done, we will see some missing modules that needs to be installed And that can be installed by the command below:
|
||||
|
||||
# cd /var/www/html/bugzilla
|
||||
# perl install-module.pl --all
|
||||
|
||||
This will take a bit time to download and install all dependencies. Run the **checksetup.pl –check-modules** command again to verify there are nothing left to install.
|
||||
|
||||
Now we'll need to run the below command which will automatically generate a file called “localconfig” in the /var/www/html/bugzilla directory.
|
||||
|
||||
# ./checksetup.pl
|
||||
|
||||
Make sure you input the correct database name, user, and password we created earlier in the localconfig file
|
||||
|
||||
# nano ./localconfig
|
||||
|
||||
# checksetup.pl
|
||||
|
||||
![bugzilla-success](http://blog.linoxide.com/wp-content/uploads/2014/12/bugzilla-success.png)
|
||||
|
||||
If all is well, checksetup.pl should now successfully configure Bugzilla.
|
||||
|
||||
Now we need to add Bugzilla to our Apache config file. so, we'll need to open /etc/httpd/conf/httpd.conf (For CentOS) or etc/apache2/apache2.conf (For Ubuntu) with a text editor:
|
||||
|
||||
For CentOS:
|
||||
|
||||
# nano /etc/httpd/conf/httpd.conf
|
||||
|
||||
For Ubuntu:
|
||||
|
||||
# nano etc/apache2/apache2.conf
|
||||
|
||||
Now, we'll need to configure Apache server we'll need to add the below configuration in the config file:
|
||||
|
||||
<VirtualHost *:80>
|
||||
DocumentRoot /var/www/html/bugzilla/
|
||||
</VirtualHost>
|
||||
|
||||
<Directory /var/www/html/bugzilla>
|
||||
AddHandler cgi-script .cgi
|
||||
Options +Indexes +ExecCGI
|
||||
DirectoryIndex index.cgi
|
||||
AllowOverride Limit FileInfo Indexes
|
||||
</Directory>
|
||||
|
||||
Lastly, we need to edit .htaccess file and comment out “Options -Indexes” line at the top by adding “#”
|
||||
|
||||
Lets restart our apache server and test our installation.
|
||||
|
||||
For CentOS:
|
||||
|
||||
# service httpd restart
|
||||
|
||||
For Ubuntu:
|
||||
|
||||
# service apache2 restart
|
||||
|
||||
![bugzilla-install-success](http://blog.linoxide.com/wp-content/uploads/2014/12/bugzilla_apache.png)
|
||||
|
||||
Finally, our Bugzilla is ready to get bug reports now in our Ubuntu 14.04 LTS and CentOS 6.5 and you can browse to bugzilla by going to the localhost page ie 127.0.0.1 or to your IP address in your web browser .
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/tools/install-bugzilla-ubuntu-centos/
|
||||
|
||||
作者:[Arun Pyasi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
||||
[1]:http://www.bugzilla.org/download/
|
Loading…
Reference in New Issue
Block a user